Documentation
 
 
 

Chapter 24. EnterpriseDB JDBC Connector

Table of Contents
24.1. JDBC Versions
24.2. JDBC Driver Types
24.2.1. Type 1 Driver
24.2.2. Type 2 Driver
24.2.3. Type 3 Driver
24.2.4. Type 4 Driver
24.3. JDBC Interface
24.4. JDBC Installation
24.4.1. Obtaining EnterpriseDB JDBC Connector
24.4.2. Installing EnterpriseDB JDBC Connector
24.4.3. Installing Java
24.5. Using EnterpriseDB JDBC Connector with Java applications
24.5.1. HelloWorld Test Program
24.5.2. Loading EnterpriseDB JDBC Connector
24.5.3. Connecting to the Database
24.5.4. Additional Connection Properties
24.5.5. Handling Errors
24.6. Executing Queries through Statement Objects
24.6.1. Building a Statement Object
24.6.2. Executing SQL
24.6.3. Displaying Results
24.6.4. Using the ResultSet Object
24.6.5. More Advanced Example
24.7. Executing a Query with no results
24.7.1. Insert Example
24.7.2. Update Example
24.7.3. Delete Example
24.7.4. Create Table Example
24.7.5. Alter Table Example
24.7.6. Drop Table Example
24.8. Advanced EnterpriseDB JDBC Connector Functionality
24.8.1. Getting results based on a cursor
24.8.2. Example
24.8.3. Using PreparedStatements
24.8.4. Executing Stored Procedures
24.8.5. Invoking Stored Procedures
24.8.6. Example 1: Executing a Simple Stored Procedure
24.8.7. Example 2:Executing Stored Procedures with IN parameters
24.8.8. Example 3: Stored Procedure with OUT parameters
24.8.9. Example 4:Executing Stored Procedures with IN OUT parameters
24.8.10. Using REF CURSORS with Java
24.8.11. Example Using REF CURSOR in Java
24.8.12. Using BYTEA Datatype
24.8.13. Example 5: Inserting a picture
24.8.14. Example 6: Retrieving a picture
24.8.15. Notification Handler

Due to the fact that Java is used by many software developers for implementing software solutions Sun created a standardized interface for connecting to databases from Java known as Java Database Connectivity (JDBC).

The driver used for connecting a Java application to an EnterpriseDB database, is known EnterpriseDB JDBC Connector.

24.1. JDBC Versions

Ever since Sun came out with JDBC version 1.0 in 1997, they have introduced several different versions to date. The initial version 1.0 specification supported the interfaces needed for creating an instance of the driver in a Java application, building basic SQL statements to execute against an underlying database, returning results via a ResultSet object and obtaining some metadata information.

This was followed by the 2.0/2.1 specification which split the original specification into two parts:

  • Core API for 2.0: Support for SQL 99 data types, programmatic SQL statements, scrollable ResultSets, streams, performance enhancements and a couple of other small features.

  • JDBC 2.0 Optional Package: This package includes interfaces for data source interfaces, distributed transactions, RowSets as well as Connection Pooling.

The latest specification of JDBC is 3.0 which was released in 2002. This version is supported by Java 1.4.x onwards and features several other enhancements to ResultSets, datatypes, connection pooling as well as the introduction of some advanced features like savepoints and ParameterMetaData support .

EnterpriseDB JDBC fConnection is build using JDBC 3.0 specifications, although this does not in any way mean that it provides support for all JDBC 3.0 specifications.

 
 ©2004-2007 EnterpriseDB All Rights Reserved