• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

help needed for this query...

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm.

What are the datatypes of the columns the query returns?
reply
    Bookmark Topic Watch Topic
  • New Topic