The IBM® Developer Kit for Java™ JDBC driver, also known as the "native" driver, provides programmatic access to iSeries™ database files. Using the Java Database Connectivity (JDBC) API, applications written in the Java language can access JDBC database functions with embedded Structured Query Language (SQL), run SQL statements, retrieve results, and propagate changes back to the database. The JDBC API can also be used to interact with multiple data sources in a distributed, heterogeneous environment.
The SQL99 Command Language Interface (CLI), on which the JDBC API is based, is the basis for ODBC. JDBC provides a natural and easy-to-use mapping from the Java programming language to the abstractions and concepts defined in the SQL standard.
To use the JDBC driver, see the following:
Get started with JDBC You can follow the tutorial of writing a JDBC program and running it on your iSeries server.
Connections An application program can have multiple connections at one time. You can represent a connection to a data source in JDBC by using a Connection object. It is through Connection objects that Statement objects are created for processing SQL statements against the database.
JVM properties Some settings used by the native JDBC driver cannot be set using a connection property. These settings must be set for the JVM in which the native JDBC driver is running.
DatabaseMetaData The DatabaseMetaData interface is used by application servers and tools to determine how to interact with a given data source. Applications may also use DatabaseMetaData methods to obtain information about a specific data source.
Exceptions The Java language uses exceptions to provide error-handling capabilities for its programs. An exception is an event that occurs when you run your program that disrupts the normal flow of instructions.
Transactions A transaction is a logical unit of work. Transactions are used to provide data integrity, correct application semantics, and a consistent view of data during concurrent access. All JDBC-compliant drivers must support transactions.
Statement types The Statement interface and its PreparedStatement and CallableStatement subclasses are used to process SQL commands against the database. SQL statements cause the generation of ResultSet objects.
ResultSets The ResultSet interface provides access to the results generated by running queries. Data of a ResultSet can be thought of as a table with a specific number of columns and a specific number of rows. By default, the table rows are retrieved in sequence. Within a row, column values can be accessed in any order.
JDBC object pooling Since many objects used in JDBC are expensive to create such as Connection, Statement, and ResultSet objects, significant performance benefits can be achieved by using JDBC object pooling. With object pooling, you can reuse these objects instead of creating them every time you need them.
Batch updates Batch update support allows many updates to the database to be passed as a single transaction between the user program and the database. Batch updates can significantly improve performance when many updates must be performed at once.
Advanced data types There are several new data types called SQL3 data types that are provided in the iSeries database. The SQL3 data types give you a tremendous amount of flexibility. They are ideal for storing serialized Java objects, Extensible Markup Language (XML) documents, and multimedia data such as songs, product pictures, employee photographs, and movie clips. The SQL3 data types include the following:
- Distinct types
- Large objects such as Binary Large Objects, Character Large Objects, and Double Byte Character Large Objects
- Datalinks
RowSets The RowSet specification is designed to be more of a framework than an actual implementation. The RowSet interfaces define a set of core functionality that all RowSets have.
Distributed transactions The Java Transaction API (JTA) has support for complex transactions. It also provides support for decoupling transactions from Connection objects. JTA and JDBC work together to decouple transactions from Connection objects and allows you to have a single connection work on multiple transactions concurrently. Conversely, it allows you to have multiple connections work on a single transaction.
Performance tips You can obtain the best possible performance from your JDBC applications with these performance tips.
For more information about JDBC, see the JDBC documentation by Sun Microsystems, Inc.
For more information about iSeries native JDBC driver, see iSeries native JDBC Driver FAQS .