SQLÓï¾äÕýÈ·µ«ÊÇRESULTSETÖÐûÓÐÖµ
StringBuffer str = new StringBuffer("select * from menu where parentid=1 and mid <>1 order by parentid");
List list = new ArrayList();
ResultSet rst = null;
DataBaseConnection dbc = null;
PreparedStatement pstm = null;
try {
dbc = new DataBaseConnection();
pstm = dbc.getConnection().prepareStatement(str.toString());
rst = dbc.query(pstm);
while(rst.next()){
System.out.println(rst.getString("name"));
}
RSTÖÐûÓÐÈκÎÖµ
Êý¾Ý¿â ORACLE 10G
²»ÖªµÀÄãµÄÊÇÔõô·â×°µÄ²éѯ£¬ÓÐÎÊÌâÒ»¶¨ÊÇdbc.query(pstm)ûÓеõ½ÕýÈ·µÄ½á¹û¼¯
Ϊʲô²»Ö±½Ó²éѯÄØ£¿
try {
dbc = new DataBaseConnection();
pstm = dbc.getConnection().prepareStatement(str.toString());
rst = pstm.executeQuery();
while(rst.next()){
System.out.println(rst.getString("name"));
}
public ResultSet query(PreparedStatement pstm) throws SQLException,
Exception {
this.rst = pstm.executeQuery();
return rst;
}
ÕâÊǺǫ́²éѯ
·â×°Õâ¸ö·½·¨ºÃÏñûɶÒâÒå°¡
ÄãµÄsqlÔÚ¹¤¾ßÀïÄܲé³ö¶«Î÷Âð£¿
public ResultSet query(PreparedStatement pstm) throws SQLException,
Exception {
return pstm.executeQuery();
}
PLSQL DEVELOPER Äܲé³öÀ´£¬½á¹ûÕýÈ·
Ö
Ïà¹ØÎÊ´ð£º
Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
¿ÉÄÜÒòΪ¹¤×÷µÄÔÒò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......
½«Ò»¸ö²éѯÓï¾ä¸³¸øÒ»¸ö±äÁ¿£¬ÈçÏ£º
DECLARE @STR NVARCHAR(MAX)
SET @STR='SELECT * from SALE_PROD'
ÔõôÑù²ÅÄÜÖ´ÐÐËüÄØ£¿
Çë¸ßÊÖ£¬ÈÊÐÖ£¬ÏÀ½ã°ï°ïæ°¡
¶àл£¬¿ÉÒÔÀ²£¬¸ßÊÖ°¡
Ö±½ÓÖ´ÐоÍÐÐÁË
exec ......
A±í ÓÐÁ½¸ö×Ö¶Î
id ΨһÊý×ÖÓò
InfoTxt text ÀàÐÍ
ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×ֶΠÎı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa'
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......