File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc excuteQuery gives null

 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is my jdbc query

it gives null.Actually there is no value relevant to id=2222.but it should give Resultset object.
why is that?
 
Rob Spoor
Sheriff
Pie
Posts: 20393
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the executeQuery method returns null you should contact the implementor, because it just shouldn't. It should give you an empty ResultSet instead, meaning rs.next() will return always false.

Moving to JDBC.
 
Sanket Akre
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this :
Statement statement = null;
ResultSet FaqResult = null;
statement = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY , ResultSet.CONCUR_READ_ONLY);
FaqResult = statement.executeQuery("SELECT * FROM FAQ WHERE faq_id=2222");

while(FaqResult.next())
{
.
.

}
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic