Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

ExecuteQuery Error

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi when i run following code

String N= "abc";
ResultSet rset2 = stmt.executeQuery("select price from stock where symbol='"+N+"'");
System.out.println("value is "+rset2);

i get error oracle.jdbc.driver.OracleResultSetImpl@2c84d9

But query works for simple statement select * from stocks;
Any idea please guide me.
Thanks
Lalit
 
Marshal
Posts: 26915
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That isn't an error. That is simply the value returned by the toString() method of the ResultSet you created. It doesn't mean anything, true, but then it doesn't mean anything to print a ResultSet anyway. Normally the next part of your code would read through the ResultSet and extract the data from it.
 
Lalit Vora
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Can explain in more simpler way i am not getting it. How will i get my actual value from resultset like i should get price as 26.97 instead this value. How to display then original value so that i can display it in report?

Please guide me

Thanks
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic