This week's book giveaway is in the Android forum.
We're giving away four copies of Android Programming: The Big Nerd Ranch Guide and have Bill Phillips & Chris Stewart on-line!
See this thread for details.
Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with ResultSet  RSS feed

 
Haritha Gorijavolu
Greenhorn
Posts: 21
Debian Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Publisher:xyz
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
Greenhorn
Posts: 21
Debian Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!