

Class.forName("2.DB2Driver") // Establish the Connection String url = "jdbc:datadirect:db2://corpserver1:50000 DatabaseName=ACCTNG" Connection con = DriverManager.getConnection(url, "test04", "test04") // Verify the Connection DatabaseMetaData metaData = con.getMetaData() ("Database Name: " + metaData.getDatabaseProductName()) ("Database Version: " + metaData.getDatabaseProductVersion()) ĭB2 UDB for z/OS and i Platforms: // Register the driver with the driver manager // If using Java SE 6 or higher, you can omit this step. Java SE 6 and higher automatically registers the driver. If using Java SE 6 or higher, you can omit this step. Jdbc:datadirect:db2://corpserver1:50000 LocationName=ACCTNGĬonnect Series for JDBC User's Guide for a complete description of theĬonnection URL syntax and descriptions of the connection properties that can beĭB2 for Linux/UNIX/Windows: // Register the driver with the driver manager. Z/OS or i platform database with a location name of ACCTNG on the server namedĬorpserver1 on port 50000, the following URL would be used: Jdbc:datadirect:db2://corpserver1:50000 DatabaseName=ACCTNG Port 50000, the following URL would be used: LocationName= location_name]įor Linux/UNIX/Windows database named ACCTNG on the server named corpserver1 on The classname and connection URL syntax for the DB2 driver are:ĭB2 for Linux/UNIX/Windows: jdbc:datadirect:db2:// servername: port DatabaseName= db_nameĭB2 for z/OS and i platforms: jdbc:datadirect:db2:// servername: port Java SE 6Īnd higher automatically registers the driver with the JDBC Driver Manager. IMPORTANT: If using Java SE 6 or higher as a Java Virtual Machine (JVM), youĭo not need to register the driver and can skip this step. Then invoke the DriverManager.getConnection() method while supplying a Must register the class name of the JDBC driver with the Driver Manager, and To establish a database connection using the Driver Manager, an application Set your system CLASSPATH to include the following entry: install_dir/lib/db2.jar Driver Manager The DB2 driver requires a Java SE 5 or higher JVM. Information on using data sources, refer to the DataDirect ConnectĬlick the following links for specific information about each driver: You need to get started using the drivers with the Driver Manager. The following sections provide information Once the DataDirect Connect for JDBC drivers are installed, you can connectįrom your application to your database in two ways: using the JDBC Driver

Series for JDBC ™ drivers immediately after installation.įor installation instructions, refer to the DataDirect Connectįor JDBC Series Installation Guide. To connect with and test your Progress ® DataDirect Connect ®

The following basic information allows you
