Chapter 18. EDB Connector/Java

Table of Contents
18.1. JDBC Versions
18.2. JDBC Driver Types
18.2.1. Type 1 Driver
18.2.2. Type 2 Driver
18.2.3. Type 3 Driver
18.2.4. Type 4 Driver
18.3. JDBC Interface
18.4. JDBC Installation
18.4.1. Obtaining EDB Connector/Java
18.4.2. Installing EDB Connector/Java
18.4.3. Installing Java
18.5. Using EDB Connector/Java with Java applications
18.5.1. HelloWorld Test Program
18.5.2. Loading EDB Connector/Java
18.5.3. Connecting to the Database
18.5.4. Additional Connection Properties
18.5.5. Handling Errors
18.6. Executing Queries through Statement Objects
18.6.1. Building a Statement Object
18.6.2. Executing SQL
18.6.3. Displaying Results
18.6.4. Using the ResultSet Object
18.6.5. More Advanced Example
18.7. Executing a Query with no results
18.7.1. Insert Example
18.7.2. Update Example
18.7.3. Delete Example
18.7.4. Create Table Example
18.7.5. Alter Table Example
18.7.6. Drop Table Example
18.8. Advanced EDB Connector/Java Functionality
18.8.1. Getting results based on a cursor
18.8.2. Example
18.8.3. Using PreparedStatements
18.8.4. Executing Stored Procedures
18.8.5. Invoking Stored Procedures
18.8.6. Example 1: Executing a Simple Stored Procedure
18.8.7. Example 2:Executing Stored Procedures with IN parameters
18.8.8. Example 3: Stored Procedure with OUT parameters
18.8.9. Example 4:Executing Stored Procedures with IN OUT parameters

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 EDB database, is known EDB Connector/Java.

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

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 .

EDB Connection/Java 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.