Troubleshooting
Using JDBC
Why does the DriverManager tell me that no suitable driver exists?
This usually happens for one of three reasons:
You mistyped the JDBC URL and the driver manager doesn't recognize the database type.
You didnt load the JDBC driver class with Class.forName, and you didn't add it to the jdbc.drivers system property.
The driver class isn't in the classpath.
My driver is in the classpath; why can't I connect to the database?
Your database URL may be incorrect, or you may be using the wrong driver.
Why do I get errors saying I can't allocate any more database statements after my program has been running for a few minutes?
If you don't explicitly close your Statement objects, they don't get closed until the garbage collector picks them up, which may not occur for a long time. Because a database statement takes up resources in the database as well, or at least in the driver, there is usually a limit to the number of open statements you can have. Under a heavy load, you might end up allocating more statements than the database can handle. The garbage collector only understands memory shortages; it isn't smart enough to clean up old statements when the database can't handle any more.