Important JDBC Concepts

Transactions: Whenever a connection is created by using the JDBC, then by default it is in auto- commit mode. This means that SQL statement will be automatically committed immediately after it is executed and it is treated as a transaction.


 

Ads

Tutorials   
JDBC Video Tutorial: Create, Read, Update and Delete (CRUD) Operation examples JDBC Video tutorial - How to read Data from MySQL Database? JDBC Video tutorial - How to delete Data in a MySQL Database? Solving java.lang.ClassNotFoundException: com.mysql.jdbc.Driver exception JDBC Video tutorial - How to update Data in a MySQL Database? JDBC Video Tutorial- How to insert data into MySQL database table? JDBC Video Tutorial: How to download JDBC Driver for MySQL? JDBC Tutorial - Writing first JDBC example and running in Eclipse Java Cross Join MySQL Database Connectivity Example In Java Change Column Name in MySQL Java Mysql Connection Example JDBC ODBC Connection In Java ResultSet In Java Prepared Statement Example JdbcRowSet interface Java JdbcRowSet Example First Step towards JDBC! JDBC Training, Learn JDBC yourself Jdbc Get Column Names JDBC Example with MySQL JDBC Prepared Statement Update JDBC Prepared Statement Insert JDBC Prepared Statement Example JDBC Prepared statement Close JDBC Prepared Statement Addbatch JDBC Nested Resultset JDBC-Odbc Connection JDBC-Odbc Connectivity JDBC Insert Preparedstatement JDBC Insert Null JDBC Get Metadata JDBC Insert Record Jdbc Insert Statement JDBC Meta Data Get tables Jdbc Mysql Connection String Jdbc Mysql Connection Url JDBC Next Jdbc Get Connection JDBC Get Int JDBC Exception JDBC Get Row Count JDBC Functions JDBC Fetch JDBC Execute Update Example JDBC Execute Statement JDBC Execute Query JDBC Drive For Mysql JDBC Connectivity Code In Java JDBC connection timeout
Ads

Important JDBC Concepts

     

Transactions: Whenever a connection is created by using the JDBC, then by default it is in auto- commit mode. This means that SQL statement will be automatically committed immediately after it is executed and it is treated as a transaction. But imagine a situation where you want to execute a batch of statements, either they should commit at on go or they should get failed together. For this we need to disable the auto- commit mode by using the method:

con.setAutoCommit(false).

After setting the auto- commit as false, no SQL statement will be committed until we call the con.commit() method. If there arises any problem while committing then the set of statements will be rollback, without committing.

Logging: on the server--->logging--->JDBC.

By this we can enable JDBC logging and specify a log file name for the JDBC log.

Attributes of Logging:

1) Enable JDBC Logging: It determines whether the server has a JDBC log file.

2) JDBC Log File Name: It is the name of the log file.

Isolation: The isolation is needed when there are concurrent transactions. Concurrent transactions are transactions are transactions that occurs at the same time. In isolation one transaction does not interfere with another. For setting the isolation level for a JDBC transaction, use the

Connection.setTransaction(int level) method

By using the snapshot isolation level we can only see the snapshot of the data locked by other transactions when running from inside the transaction with snapshot isolation level.

Some of the transaction level are given below:

1). TRANSACTION_NONE

2). TRANSACTION_READ_UNCOMMITED

3. TRANSACTION_READ_COMMITTED

4. TRANSACTION_REPEATABLE_READ

5. TRANSACTION_SERIALIZABLE

By setting the isolation levels you are having an impact on the performance of the transaction. You can get the existing isolation level with:

getTransactionIsolation() method.

Concurrency: Database concurrency controls ensure that the transactions occur in an ordered fashion.

Concurrency control deals with the issue involved with allowing multiple people simultaneous access to shared entities.

 

Advertisements

Share on Google+Share on Google+

Important JDBC Concepts

Posted on: April 13, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Important JDBC Concepts   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
p.eswari
July 1, 2011
hai

no comment i want only j2ee concept program

Ads

 

Ads