![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e240. Committing and Rolling Back Updates to a DatabaseBy default, a connection commits all updates to the database immediately and automatically. For example, executing an UPDATE SQL query immediately commits the change. This example shows how to disable auto-commits and explicitly commit.try { // Disable auto commit connection.setAutoCommit(false); // Do SQL updates... // Commit updates connection.commit(); } catch (SQLException e) { // Rollback update connection.rollback(); }
e236. Connecting to a MySQL Database e237. Connecting to a SQLServer Database e238. Listing All Available Parameters for Creating a JDBC Connection e239. Determining If a Database Supports Transactions e241. Handling a SQL Exception e242. Determining If a SQL Warning Occurred e243. Getting the Driver of a Connection e244. Setting the Number of Rows to Prefetch When Executing a SQL Query © 2002 Addison-Wesley. |