DB2 Version 9.7 for Linux, UNIX, and Windows

Connecting to a data source using SQLJ

In an SQLJ application, as in a database application in any other language, you must be connected to a data source before you can execute SQL statements.

You can use one of six techniques to connect to a data source in an SQLJ program. Two use the JDBC DriverManager interface, two use the JDBC DataSource interface, one uses a previously created connection context, and one uses the default connection.