日期:2014-05-17  浏览次数:20796 次

oracle语句在jdbc中报错的问题
String sql="select b.id id,b.product_name product_name,b.description description,b.add_time add_time,b.fixed_price fixed_price,b.dang_price dang_price,b.keywords keywords,b.has_deleted has_deleted,b.product_pic product_pic,b.author author,b.publishing publishing,b.publish_time publish_time,b.word_number word_number,b.which_edtion which_edtion,b.total_page total_page,b.print_time print_time,b.print_number print_number,b.isbn isbn,b.catalogue catalogue,b.author_summary author_summary from (select a.id,a.product_name,a.description,a.add_time,a.fixed_price,a.dang_price,a.keywords,a.has_deleted,a.product_pic,a.author,a.publishing,a.publish_time,a.word_number,a.which_edtion,a.total_page,a.print_time,a.print_number,a.isbn,a.catalogue,a.author_summary,rownum rnum from (select id,product_name,description,add_time,fixed_price,dang_price,keywords,has_deleted,product_pic,author,publishing,publish_time,word_number,which_edtion,total_page,print_time,print_number,isbn,catalogue,author_summary from (select dp.id,product_name,description,add_time,fixed_price,dang_price,keywords,has_deleted,product_pic,author,publishing,publish_time,word_number,which_edtion,total_page,print_time,print_number,isbn,catalogue,author_summary from  d_product dp join d_book db on(dp.id=db.id) order by add_time desc)) a where rownum<6) b  where rnum>=0;";
Statement stat=getConnection().createStatement();
ResultSet rs=stat.executeQuery(sql);


上面的那个sql语句在oracle里面是可以查到数据的,但是放到java的jdbc就报错了,最后一行报错,java.sql.SQLException: ORA-00911: 无效字符

各位大神  求救了   
------最佳解决方案--------------------
把最后的分号去掉。
------其他解决方案--------------------
上面说的对。
------其他解决方案--------------------
上面两位说的都对。