The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

- None of the exceptions above are re-thrown. My guess is that if something goes wrong then the application should let you know right away instead of failing "silently".

- With the way the exceptions are being caught you can still continue down your code path. For example if the classname part of the code fails then you're still going to attempt to get a connection.

- Your code isn't thread safe. For example, the method setException is called from two other methods and one thread could interfere with the other thread.

- Your code is quite coupled together. One of the goals of OO programming is HIGH cohesion and LOW coupling. This class does everything: attempts to create the driver class, open the connection, create the prepared statement, close the connection, etc... That is a lot of work for one class. Consider making a connection pool interface that has a simple implementation class that is access via a Factory.