This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes problem with ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with ResultSet" Watch "problem with ResultSet" New topic

problem with ResultSet

Haritha Gorijavolu

Joined: Feb 18, 2011
Posts: 21

I am using the following code to get data from a database and display it.

I am getting the following output:

Magazine info:

Magazine ID:1
Magazine Name:haritha
Frequency:weekly EXCEPTION:No data found

When I use currid instead of rst.getString(1) in the out.println() of last line of while loop, the code works fine. Why is it not working for rst.getString(1)? Please help.
Haritha Gorijavolu

Joined: Feb 18, 2011
Posts: 21

I m sorry. This script was to be in a JSP. So I choose JSP. However, the problem is with the result set. I should have posted it in JDBC.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

It looks like you may be using DB2. If so, why are you using the JDBC-ODBC bridge? I would recommend using a type 4 driver instead.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: problem with ResultSet
Similar Threads
problem retrieving from database
servlets using JDBC
database accessing time
update problem in oracle
how to connect to mysql using jsp