Developing DB2 Everyplace Java applications

To develop a DB2® Everyplace® application using Java™, you can use the Java Software Developer's Kit together with the DB2 Everyplace Java Database Connectivity (JDBC) interface for Java.

Install Java and JDBC on your workstation if you have not already done so, because a Java application that accesses DB2 Everyplace uses the DB2 Everyplace JDBC driver.

To develop DB2 Everyplace Java applications:

  1. Import the java.sql package and any other necessary Java classes.
  2. Connect to the database either using the DriverManager class or the DataSource interface. See the sample Java application for details. The JDBC URL syntax is jdbc:subprotocol:subname. The DB2 Everyplace subprotocol is db2e.
  3. Create a Statement object.
  4. Access the database (your application logic goes here):
    1. Execute a SQL statement using the Statement object.
    2. Retrieve data from the returned ResultSet object (if the SQL statement you executed is a query).
  5. Release database and JDBC resources by closing the ResultSet, Statement, and Connection objects.
Related reference
Overview of DB2 Everyplace JDBC support


Library | Support | Terms of use

Last updated: Wednesday, October 17, 2006
(C) Copyright IBM Corporation 2004, 2006. All Rights Reserved.
This information center is built on Eclipse. (http://www.eclipse.org)