• 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

help! perhaps the problems of configuration of JDBC on Weblogic

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Oracle+Weblogic+JBuilder, I got a very strange problem. When I use PreparedStatement to pass parameters to query data, I cannot get the data, it always throws ObjectNotFoundException. But if I use Statement to query data, it works.
for example.
//Policy: a table in Oracle Database
String sql = "select * from policy where id='"+this.id+"'";
st.executeQuery(sql);
//this works
//but for this
String sql = "select * from policy where id=?";
PreparedStatement ps = con.createPreparedStatement(sql);
ps.setString(this.id);
ps.executeQuery();
//it throws ObjectNotFoundException
any help would be appreciated!
thanx in advance
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you meant to say:

and this.id is of type String?

And what is throwing ObjectNotFoundException? - this would not be thrown by any of the above code, but by an entity bean finder method.
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic