ÔÚoracleÖÐÓÃjdbcÀ´Á¬½ÓÊý¾Ý¿â£¬ÎªÊ²Ã´ResultsetÀïÃæǶÌ×ResultSet,µ½Ñ»·µÄµÚ¶þ´Î¾Í±¨¿ÕÖ¸Õ룬ÄÄλ֪µÀÊÇÔõô»ØÊÂÂð£¿
´úÂ룺Java code:
while(prors.next()){
System.out.println(prors.getRow());
Date startime = prors.getTime("starttime");
String st = sf.format(startime);
String ft = sf.format(prors.getTime("finishtime"));
int rt = (int) (sf.parse(ft).getTime()-sf.parse(st).getTime())/1000;
int ssid = prors.getInt("seresscriptid"); //ÕÒµ½ÏµÁеÄid
String ssql = "select * from seriescript where id ="+ssid;
ResultSet srs = stmt.executeQuery(ssql);
srs.absolute(1);
System.out.println(srs.getString("name"));//»ñÈ¡½Å±¾ÏµÁеÄÃû×Ö
srs.beforeFirst();
}
±¨´íÈçÏ£º
Java code:
Exception in thread "main" java.lang.NullPointerException
at oracle.jdbc.driver.ScrollableResultSet.cacheRowAt(ScrollableResultSet.java:1588)
at oracle.jdbc.driver.ScrollableResultSet.isValidRow(ScrollableResultSet.java:1571)
at oracle.jdbc.driver.ScrollableResultSet.next(ScrollableResultSet.java:301)
at test.main(test.java:49)
3-5ÈË£¬¹¤×÷µØµãÉϺ£ÆÖ¶«Èí¼þÔ°£¬2-3Äê¾Ñ飬ӢÎÄÁ÷Àû£¬ÓÐÒâÕßÇëÁªÏµ38954510-1355£¬15821699737£¬y.ming@live.cn
×Ô¼º¶¥¡£¡£¡£
ûÓÐORACLE ERPµÄ¾Ñé,ÓÐÓÃÓѺÍTIPTOP¾Ñé,Ó¢Óï˵²»ºÃ,¿´»¹ÊÇ¿ÉÒÔ!
²»ÖªµÀÓÐûÓÐ ......