File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes help needed for this query... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "help needed for this query..." Watch "help needed for this query..." New topic
Author

help needed for this query...

toukhir mujawar
Ranch Hand

Joined: Oct 11, 2006
Posts: 70
friends i am trying to run this code and getting some error...please help me...


the code is like....

PreparedStatement pst = conn.prepareStatement("select distinct a.user_code,b.s_name,a.amount from tbl_daily_collection a, tbl_admcd b where a.user_code in (select distinct subdiv from tbl_admcd where div = ?) and b.subdiv = a.user_code");
pst.setInt(1,user);
ResultSet rs1 = pst.executeQuery();


and the detailed error message is like this....


500 Internal Server Error
java.sql.SQLException: Fail to convert to internal representationat oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)at oracle.jdbc.driver.CharCommonAccessor.getDouble(CharCommonAccessor.java:295)at oracle.jdbc.driver.OracleResultSetImpl.getDouble(OracleResultSetImpl.java:600)at _ViewDivCollection._jspService(_ViewDivCollection.java:73)[/ViewDivCollection.jsp]at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)at java.lang.Thread.run(Thread.java:595)



please help...


regards

Toukhir Mujawar
Chris Hendy
Ranch Hand

Joined: Mar 04, 2006
Posts: 98
What type is user in



and what datatype is column tbl_admcd.div

It looks as if jdbc can't map user to an integer.
toukhir mujawar
Ranch Hand

Joined: Oct 11, 2006
Posts: 70
the type of user was int and the type of div in tbl_admcd was varchar...

so i changed type of user to String and used.."pst.setString(1,user)"...

but it is still giving the same error...
Chris Hendy
Ranch Hand

Joined: Mar 04, 2006
Posts: 98
Hmm.

What are the datatypes of the columns the query returns?
 
Consider Paul's rocket mass heater.
 
subject: help needed for this query...
 
Similar Threads
getting nullPointerException on line upload.parseRequest(request);
JSTL-C using c:choose problem
Error loading the index.jsp with OC4J
possible Reasons for following Error
deployment problem - struts application