Posts

Showing posts with the label Transaction

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...

JDBC TUTORIAL

Image
What is JDBC? A JDBC driver is a software component enabling a Java application to interact with a database.It is a specification that tells vendor how to write a driver program to interface java program with their database. The JDBC driver gives out the connection to the database and implements the protocol for transferring the query and result between client and database. JDBC helps you to write Java applications that manage these three programming activities: 1.      Connect to a data source, like a database 2.      Send queries and update statements to the database 3.      Retrieve and process the results received from the database in answer to your query What are we going to cover in this tutorial?? * JDBC Architecture                                               * Types Of JDBC Drivers * Ste...