Creating a DB2 Package with dbping Syntax

2-6 Command Reference for Oracle WebLogic Server

2.9 dbping

The dbping command-line utility tests the connection between a DBMS and your client machine via a JDBC driver. You must complete the installation of the driver before attempting to use this utility. For more information on how to install a driver, see the documentation from your driver vendor. Also see Using Third-Party Drivers with WebLogic Server in Programming JDBC for Oracle WebLogic Server.

2.9.1 Creating a DB2 Package with dbping

With the WebLogic Type 4 JDBC Driver for DB2, you can also use the dbping utility to create a package on the DB2 server. When you ping the database with the dbping utility, the driver automatically creates the default package on the database server if it does not already exist. If the default package already exists on the database server, the dbping utility uses the existing package. The default DB2 package includes 200 dynamic sections. You can specify a different number of dynamic sections to create in the DB2 package with the -d option. The -d option also sets CreateDefaultPackage=true and ReplacePackage=true on the connection used in the connection test, which forces the DB2 driver to replace the DB2 package on the DB2 server. See DB2 Connection Properties in Type 4 JDBC Drivers for Oracle WebLogic Server for more information. You can use the -d option with dynamic sections set at 200 to forcibly recreate a default package on the DB2 server.

2.9.2 Syntax

java utils.dbping DBMS [-d dynamicSections] user password DB Table 2–3 describes the arguments that are passed to the dbping command-line utility. Notes: When you specify the -d option, the dbping utility recreates the default package and uses the value you specify for the number of dynamic sections. It does not modify the existing package. To create a DB2 package, the user that you specify must have CREATE PACKAGE privileges on the database. Using the Oracle WebLogic Server Java Utilities 2-7 Table 2–3 dbping Arguments Argument Definition DBMS Varies by DBMS and JDBC driver: DB2B—WebLogic Type 4 JDBC Driver for DB2 DERBY—Embedded Derby driver JCONN2—Sybase JConnect 5.5 JDBC 2.0 driver JCONN3—Sybase JConnect 6.0 JDBC 2.0 driver JCONNECT—Sybase JConnect driver INFORMIXB—WebLogic Type 4 JDBC Driver for Informix MSSQLSERVER4—WebLogic jDriver for Microsoft SQL Server MSSQLSERVERB—WebLogic Type 4 JDBC Driver for Microsoft SQL Server MYSQL— MySQLs Type 4 Driver ORACLE—WebLogic jDriver for Oracle ORACLEB—WebLogic Type 4 JDBC Driver for Oracle ORACLE_THIN—Oracle Thin Driver POINTBASE—PointBase Universal Driver SYBASEB—WebLogic Type 4 JDBC Driver for Sybase [-d dynamicSections] Specifies the number of dynamic sections to create in the DB2 package. This option is for use with the WebLogic Type 4 JDBC Driver for DB2 only. If the -d option is specified, the driver automatically sets CreateDefaultPackage=true and ReplacePackage=true on the connection and creates a DB2 package with the number of dynamic sections specified. user Valid database username for login. Use the same values you use with isql, sqlplus, or other SQL command-line tools. For DB2 with the -d option, the user must have CREATE PACKAGE privileges on the database. password Valid database password for the user. Use the same values you use with isql or sqlplus. 2-8 Command Reference for Oracle WebLogic Server

2.9.3 Examples