This code is working fine without connection pooling but when I am using connection pooling I am facing some problem .Please check the code once I have given comment.
1) Connection pool code in apache server
2)
The Error is:
java.lang.ClassCastException: oracle.jdbc.driver.OracleResultSetImpl
at com.itisl.jpmorgan.objects.FileUploadMaster.imageInsert(FileUploadMaster.java:268)
at com.itisl.jpmorgan.objects.FileUploadMaster.Insert(FileUploadMaster.java:195)
at com.itisl.jpmorgan.servlets.docupload.filename.DocUpload_Save.doPost(DocUpload_Save.java:121)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
--------------------Here are the contents for server.xml and context files used in
tomcat 6.0
Server.xml
In this I changed :type="javax.sql.DataSource" as
type:ā€¯oracle.jdbc.pool.OracleDataSourceā€¯
context.xml
web.xml
-auth>
</resource-ref>
Commons.java
Just for your reference I wrote:
This code is for without connection pool
Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+918866008962>
"Helping hands are better than praying lips......"