Connection and Transaction
Connection Interface A Connection is the session between your java program and database. SQL statements are executed and results are returned within the context of a connection. A Connection object's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on. This information is obtained with the getMetaData method. Using Transactions A transaction is a set of one or more statements that is executed as a unit, so either all of the statements are executed, or none of the statements is executed. Disabling Auto-Commit Mode When a connection is created, it is in auto-commit mode. This means that each individual SQL statement is treated as a transaction and is automatically committed right after it is executed. The way to allow two or more statements to be grouped into a transaction is to disable the auto-commit mode. This is demonstrated in the following code, where con...