Description
PowerBuilder 7 introduced two implementations of the JDBC interface: JDM to run with Microsoft's Java VM and JDS to run with Sun's Java VM. PowerBuilder 8 supports a third implementation of the JDBC interface. This implementation, called JDB, consolidates JDBC functionality into one PowerBuilder interface. This interface supports all the functionality provided in the existing JDS and JDM interfaces (which were written against the JDBC 1.0 specification) as well as functionality defined in JDBC 2.0.
The JDS and JDM interfaces continue to be supported in PowerBuilder 8, but support for these interfaces will be discontinued after PowerBuilder 8. In PowerBuilder 8 if you install the JDS or JDM interface, you get a message box warning you that support for these interfaces will be discontinued. In addition, profiles modified or created using these drivers are marked as deprecated in the list of Installed Database Interfaces in the Database Profiles dialog box and the Database painter.
The JDB interface uses a DLL named PBJDB80.DLL to access a database via a JDBC driver. It works with any JDBC-compliant driver including jConnect Version 4.2 (which supports Sun JRE 1.1 and the Microsoft VM) and 5.2 (which supports Sun JRE 1.2 or later) and the Oracle, DB2, and INFORMIX JDBC drivers.
Usage
Specifying the appropriate Java VM Since the new JDB interface is designed to consolidate support for the JDBC specifications, you must specify the version of the Java VM you want to use. Use the new JavaVM DBParm to select one of the following VMs: Sun JRE 1.1, Sun JRE 1.2, Sun JRE 1.3, Microsoft VM, or Microsoft VM (EAServer version). The following table lists the available Java VMs and their corresponding JavaVM DBParm value:
|
Java VM
|
DBParm value
|
|
Sun JRE 1.1 (the default)
|
Sun1.1
|
|
Sun JRE 1.2
|
Sun1.2
|
|
Sun JRE 1.3
|
Sun1.3
|
|
Microsoft VM
|
MS
|
|
Microsoft VM (EAServer)
|
MS-JNI
|
For consistent behavior, the same version of the Java VM used during development should be used at runtime. You must select MS-JNI if you are developing a component that will be deployed to an EAServer configured to use the Microsoft VM.
The JavaVM DBParm is set via the Options tab. You do not need to set this DBParm for a PowerBuilder component running in EAServer.
Selecting the Java VM for a component deployed to EAServer If a PowerBuilder component running in EAServer makes a database connection using JDBC, the JDB interface verifies that the Java VM used by EAServer matches the Java VM selected in the PowerBuilder database profile. If the versions do not match, the JDB interface overrides the profile setting and uses the EAServer Java VM. It also enters a warning in the EAServer log file. (The EAServer log file records errors relating to component execution. You can view its contents using the Jaguar Manager File Viewer.)
Enhanced support for the Oracle JDBC driver The JDB interface now supports the use of outer joins when working with Oracle databases. An outer join returns all the rows returned by a simple join as well as those rows from one table that do not match any row from the other table.
Support for ANSI SQL-92 outer join syntax generation The JDB interface (along with JDM and JDS) can now generate ANSI SQL-92 outer join SQL syntax when you create a new DataWindow. For more information, see Support for ANSI outer join SQL syntax generation.
Support for database proxy connections in EAServer The JDB interface (along with JDS) now allows you to retrieve a connection by proxy from a EAServer connection cache. For more information, see Support for database proxy connections in EAServer.
Configuration
If you use the new JDB interface, the configuration procedure is as follows:
- Configure the database server for its JDBC connection and install its JDBC-compliant driver and network software.
- Use the JavaVM DBParm to tell PowerBuilder what version of the Java VM is running on your machine. You must already have installed the Java VM. You do not need to se the JavaVM DBParm for a PowerBuilder component running in EAServer.
- Install the JDB interface.
- Make sure the settings in the PATH and CLASSPATH environment variables and the Java tab of the System Options dialog box point to the appropriate fully qualified filenames.
If you are using Java 1.1, the PATH environment variable should include an entry for the Sun Java VM (for example, path\ JDK118\bin) and the CLASSPATH environment variable should include an entry for the packages included in classes.zip (for example, path\ JDK118\lib\classes.zip). The CLASSPATH environment variable or the Classpaths list on the Java tab should also include an entry for the JDBC driver classes (such as jconn2.jar).
If you are using Java 1.2 or later, you do not need to include the Sun Java VM packages in your CLASSPATH variable, but your PATH environment variable must include an entry for the Sun Java VM library, jvm.dll (for example, path\ JDK122\JRE\bin\classic).
The Classpaths list on the Java tab should include an entry for the appropriate PowerBuilder Java package (pbjdbc11.jar or pbjdbc12.jar). This entry is added automatically when you install the JDBC interface.
Also verify that you do not have another Java VM entry in the PATH and CLASSPATH environment variables as multiple VM entries may cause the database connection to fail.
For more information
For more detailed information about JDBC, go to the Java Web site at http://java.sun.com/products/jdbc/ .
Also see the DBParm descriptions in the online help:
JavaVM
OJSyntax
ProxyUserName
For information about new DBParms, select the What's New button on the Help window and select New DBParms.
|