• Post Reply Bookmark Topic Watch Topic
  • New Topic

using connection pooling with servlet  RSS feed

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to connect to a database through a servlet. I am getting the following error message:

    sun.jdbc.odbc.JdbcOdbcConnection
    Error: 500
    Location: /servlet/ProjectRequestProcessingInternal Servlet Error:java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcConnection
    at ConnectionPool.returnConnection(ConnectionPool.java:180)
    at ProjectRequestProcessing.doPost(ProjectRequestProcessing.java:86)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

    I am not sure what the problem is, primarily because I don't know where the error is occuring. I have a servlet called ProjectRequestProcessing and a helper class called ConnectionPool. But I am not quite sure what the where the problem is occuring. Can any shed some light on this?
    Thanks in advance
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think the error is with the connection pool class. There is some problem in the casting you have done in the connection pool class. Try to solve it.
Subramanian
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope you have Your Connection Pool's Java File with you.
1)
refer to its returnConnection() method and check what is on the left hand side of "DriverManager.getConnection() method". I guess the object on left side is of a class which doesn't implement Connection interface.
ref: ConnectionPool.returnConnection(ConnectionPool.java:180)
2) If everything is right there, then plz check in your file where you are calling this function than that may be the place which is causing you trouble.

------------------
Amit Agrawal,
New Delhi, India.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!