The connection process
The DataWindow Web control and Transaction Object control make database connections using JDBC. Their Java classes interact with the Java classes of the database vendor's JDBC interface. The vendor's classes interact with the database.
JDBC driver from a database vendor
The classes for the JDBC database driver you plan to use must be available to the user's browser. If the user won't have them installed already, you can set up the web page so that they are downloaded and installed just as you do for the DataWindow Web control.
To have the JDBC driver classes installed automatically, you can:
- Convert the database vendor's Java classes into a CAB file. You can use a Microsoft utility called CABARC to do the conversion. The classes can be in a ZIP archive or directory tree.
- Add an Object element with a CODEBASE attribute for the CAB file to the web page.
The browser will download the CAB file and add the classes to its internal class path. There won't be any change to the CLASSPATH environment variable.
If you want to use the JDBC driver when you are defining DataWindow objects, you will need to do some additional installation, such as putting the JDBC driver classes on the system class path.
For more information, see database connectivity topics in the PowerBuilder What's New documentation.
Connection properties
The connection information for the Transaction Object or Web control is set as Param elements enclosed in the Object element. Whether you use a separate Transaction object or the internal connection properties of the Web control, the connection properties are the same:
|
Param name
|
Meaning
|
Typical value
|
|
LogID
|
The ID needed to log into the database
|
dba (default ID for ASA databases)
|
|
LogPass
|
The password needed to log into the database
|
sql (default password for ASA databases)
|
|
dbParm
|
A string specifying the Java classes for the driver and the URL for the database
|
For the JConnect driver: Driver='com.sybase.jdbc.SybDriver',URL='jdbc:sybase:Tds:199.1.1.1:9999/mydatabase'
|
|
Lock
|
The isolation level of the connection
|
Vendor-specific values
|
|
AutoCommit
|
Whether a commit occurs immediately after the database is updated
|
False (default)
|
About dbParm
For JDBC drivers, the dbParm property specifies essential connection information. Its value is a string that contains at least two values. Those values identify the driver you want to use and the URL of the database, in a format understood by the driver.
The format is:
Driver='JDBCclassname',URL='database_url'
To find the class name for Driver and the format of the database URL, check the documentation from the DBMS vendor.
For examples of setting these properties in Param elements, see "Properties and Param elements".
|