This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes help! perhaps the problems of configuration of JDBC on Weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "help! perhaps the problems of configuration of JDBC on Weblogic" Watch "help! perhaps the problems of configuration of JDBC on Weblogic" New topic
Author

help! perhaps the problems of configuration of JDBC on Weblogic

Robert Strong
Ranch Hand

Joined: Sep 10, 2002
Posts: 84
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

Joined: Jul 24, 2002
Posts: 401
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.
 
 
subject: help! perhaps the problems of configuration of JDBC on Weblogic
 
Similar Threads
Oracle IN operator with PreparedStatement
Dynamic SQL with JDBC
Unique datatype in database
connectivity problem
ms sql server could not be bound error