This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help! perhaps the problems of configuration of JDBC on Weblogic

 
Robert Strong
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • 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
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic