JDBC

1.1 Introduction to JDBC

The interface for accessing relational databases from Java is JDBC. Via JDBC you maintain the databases connection, issue database queries and updates and receive the results.
Learn More...

1.2 JDBC driver types

The JDBC API uses a Driver Manager and database-specific drivers to provide transparent connectivity to heterogeneous databases.
Learn More...
1.2.1 Type -1 JDBC-ODBC Bridge drive
The Type 1 driver translates all JDBC calls into ODBC calls and sends them to the ODBC driver.
Learn More...
1.2.2 Type -2 Native-API Partly-Java driver
The distinctive characteristic of type 2 jdbc drivers are that Type 2 drivers convert JDBC calls into database-specific calls i.e. this driver is specific to a particular database.
Learn More...
1.2.3 Type -3 JDBC-Net Pure-Java driver
Type 3 database requests are passed through the network to the middle-tier server. The middle-tier then translates the request to the database.
Learn More...
1.2.4 Type -4 Native Protocol Pure-Java driver
The Type 4 uses java networking libraries to communicate directly with the database server
Learn More...

1.3 JDBC Architecture

Sun Microsystems has included JDBC API as a part of J2SDK to develop Java applications that can communicate with databases.
Learn More...

1.4 Types of Statements

In java the statements specify the sequence of actions to be performed when a method or constructor is invoked. They can alter the value of variables, generate output, process input, or respond to user mouse or keyboard actions.
Learn More...
1.4.1 Using Statement
Statements Used for general-purpose access to your database. Statements are useful when you are using static SQL statements at runtime.
Learn More...
1.4.2 Using Prepared Statement
Prepared Statements are used when you plan to use the SQL statements many times. The PreparedStatement interface accepts input parameters at runtime.
Learn More...
1.4.3 Using Callable Statement
Callable Statement used when you want to access database stored procedures. The CallableStatement interface can also accept runtime input parameters.
Learn More...

1.5 Transaction Management

When a connection is created using JDBC, by default it is in auto-commit mode.
Learn More...

1.6 Batch Upadate

One of the more advanced features of JDBC 2.0 is the ability to submit multiple update statements to the database for processing as a single unit.
Learn More...

1.7 Scrollable ResultSet

It is a interface. A ResultSet object maintains a cursor pointing to its current row of data.
Learn More...

1.8 Types of ResultSet

There is three types of ResultSet object.
Learn More...

1.8 ResultSetMetaData

The simple meaning of metadata is data about data.
Learn More...

1.9 DataBaseMetaData

JDBC DatabaseMetaData is an interface of java.sql.*; package.
Learn More...

1.10 RowSet

JDBC RowSet is an interface of javax.sql.rowset interface.
Learn More...

1.11 SQL Exception

The java.sql package provides the SQLException class, which is derived from the java.lang.Exception class.
Learn More...

1.11 Result Sets

ResultSet provides access to a table of data generated by executing a Statement. The table rows are retrieved in sequence.
Learn More...