Why set Autocommit to true?

Only reasonable reason I can see is to get rid of the connection.commit() and connection.rollback() boilerplate in simple single-query transactions in small applications. JDBC in raw form requires by itself already a lot of boilerplate. Every line less makes JDBC less scary to starters.

When to close Connection, Statement, PreparedStatement and ResultSet in JDBC

Personally I’d use a pool as this will take care of all of the resource management for you. If your connection requirements change then you can easily modify the pool configuration. With a pool in place you can open/close connections and prepared statements according to best-practice and leave the resource management to the pool. Typically, … Read more

Why does autoReconnect=true not seem to work?

I had the same issue and it was absolutely maddening. Here’s what the docs say on the MySQL website (emphasis mine) Should the driver try to re-establish stale and/or dead connections? If enabled the driver will throw an exception for a queries issued on a stale or dead connection, which belong to the current transaction, … Read more

ojdbc14.jar vs. ojdbc6.jar

The “14” and “6” in those driver names refer to the JVM they were written for. If you’re still using JDK 1.4 I’d say you have a serious problem and need to upgrade. JDK 1.4 is long past its useful support life. It didn’t even have generics! JDK 6 u21 is the current production standard … Read more