Reputation: 37
I have code that connects to a SQL DB and queries it based on user input. I would like to connect using a Pool instead to speed up the query times. I attempted to write a Pool and Manager class but I am getting an unreported NamingException when I try to get a connection from the pool. I have also already caught NamingExceptions in my getConnection() function.
Does anyone know why I am getting this error?
Or could point me in the right direction to create a valid ConnectionPool?
Upvotes: 0
Views: 392
Reputation: 9154
You have 3 options:
Upvotes: 0
Reputation: 13561
You should use the latest JDBC driver, which supports connection pooling internal, so you don't have to write your own.
Upvotes: 1