• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error in rs.getString()

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Rakesh Keerthi
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the answer Chris
 
reply
    Bookmark Topic Watch Topic
  • New Topic