aspose file tools*
The moose likes JDBC and the fly likes Error in rs.getString() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error in rs.getString()" Watch "Error in rs.getString()" New topic
Author

Error in rs.getString()

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Hi i have the below sql query in my servlet.




here when i use
rs.getString("Query_Answered ");

it is giving me the following error




here Query_Answered is present in the Scope_Demo table, could you please let me know what i should i use to get Query_Answered in rs.


Thanks.
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1476
    
  11

Rakesh Keerthi wrote:...

This is an SQLException and it's reporting an invalid column name, so I'd start by looking at the column names in your SQL. Is "Couunt1" a valid column name? How about the others? Also, you are not fetching the query_answered column in your outer SELECT, and why is your SQL nested anyway?

Take your SQL query and test it in your SQL interpreter shell before you put it into Java. That way you can be sure the query is correct.


No more Blub for me, thank you, Vicar.
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Thanks for the answer Chris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in rs.getString()
 
Similar Threads
how to use <%=temp%> i retrieving data
Help in MVC please
Getting elements by id
Sql not working for multiple rows
How to replace a null with blank in jsp table