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 Äܲé³öÀ´£¬½á¹ûÕýÈ·
Ö
Ïà¹ØÎÊ´ð£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º
......
ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......
sqlµÄÈí¼þÔÚÄÄÀï¿ÉÒÔϰ¡£¡ÔÚÍøÉÏÕÒÁËÂù¶à¶¼Óò»Á˰¡
Ëæ±ã¸ãÒ»D°æ°É£¬
ѸÀ×µÚÒ»¸ö¾Í¿ÉÒÔÓÃ
2000,2005¶¼ÕâÑù
http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......
±íÊý¾Ý
COL1 COL2 COL2 COL4 COL5
----------------------------------------------------------------------------------------------
2010-05-05 00:00 ......