Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerbuilder 8 to HSQL using JDBC

Status
Not open for further replies.

Kevats

Programmer
Apr 19, 2002
8
IT
I'm trying to connect to a HSQL database using powerbuilder. I've checked the classpath, path and the server end (localhost) and all is ok. When I connect, Powerbuilder issues a program error and exits.

Any ideas on how connect without being kicked out of the applications?

Kevats
 
The JDBC interface uses a DLL named either PBJDS70.DLL or PBJDM70.DLL to access a database via a JDBC driver.
Required Sybase JDBC driver version
To use the JDBC interface to access the jConnect driver, use jConnect Version 4.0 or higher. For information on jConnect, see your Sybase documentation.
Required Oracle JDBC driver version
To use the JDBC interface to access the Oracle JDBC driver, use Oracle8 JDBC driver Version 8.0.3 or higher. For information on the Oracle JDBC driver, see your Oracle8 documentation.
Platforms
The JDBC interface is available on Windows 95/98 and Windows NT.
Supported JDBC data types
Like ODBC, the JDBC interface compiles, sorts, presents, and uses a list of data types that are native to the backend database to emulate as much as possible the behavior of a native interface.
Preparing to use the JDBC interface
Before you define the interface and connect to a database via the JDBC interface, follow these steps to prepare the database for use:
1Configure the database server for its JDBC connection and install its JDBC-compliant driver and network software.
2Verify that a Java VM is installed on your machine.
3Install the JDBC interface.
4Set the CLASSPATH environment variable.
Step 1: configure the database server
You must configure the database server to make JDBC connections as well as install the JDBC driver and network software.
To configure the database server for its JDBC connection:
1Make sure the database server is configured to make JDBC connections. For configuration instructions, see your database vendor's documentation.
2Make sure the appropriate JDBC driver software is installed and running on the database server. Verify that the PATH and CLASSPATH environment variables include the appropriate directories for the JDBC driver and classes.
The driver vendor's documentation should provide the driver name, URL format, and any driver-specific properties you will need to specify in the database profile.
Configuring the jConnect driver
Make sure to complete the configuration steps required by the jConnect driver such as installing the JDBC stored procedures in Adaptive Server databases.
For more information about configuring jConnect, see the jConnect for JDBC documentation.
3Make sure the required network software (such as TCP/IP) is installed and running on your computer and is properly configured so you can connect to the database server at your site.
You must install the network communication driver that supports the network protocol and operating system platform you are using.
For installation and configuration instructions, see your network or database administrator.
Step 2: verify the Java VM
Make sure the appropriate Java Virtual Machine is installed and running on your client computer: Microsoft VM for Java 2.02 or Sun Java Runtime Environment (JRE) 1.1.7. Both VMs are available free of charge from their respective vendors: ( andjava.sun.com/products (java.sun.com/products). If you are using JRE, verify that the PATH and CLASSPATH environment variables include the appropriate directories for the Java VM and classes.
Step 3: install the JDBC interface
When prompted to do so by the PowerBuilder Setup program, select the appropriate JDBC interface.
For instructions, see the Installation Guide.
Step 4: set the CLASSPATH variable
Set the CLASSPATH environment variable to include an entry to the directory containing the PowerBuilder Java package.
Defining the JDBC interface
Defining the profile
To define a connection through the JDBC interface, you must create a database profile by supplying values for at least the basic connection parameters in the Database Profile Setup - JDBC dialog box. You can then select this profile anytime to connect to your database in the development environment.
For information on how to define a database profile, see "Using database profiles".
Specifying connection parameters
To provide maximum flexibility (as provided in the JDBC API), the JDBC interface supports database connections made with different combinations of connection parameters:
lDriver name, URL, and Properties You should specify values for this combination of connection parameters if you need to define driver-specific properties. When properties are defined, you must also define the user ID and password in the properties field.
For example, when connecting to the jConnect driver, the following values should be entered in the Driver-Specific Properties field:
SQLINITSTRING=set TextSize 2; user=system;password=manager;
lDriver name, URL, User ID, and Password You should specify values for this combination of connection parameters if you do not need to define any driver-specific properties.
lDriver name and URL You should specify values for this combination of connections parameters when the user ID and password are included as part of the URL.
For example, when connecting to the Oracle JDBC driver, the URL can include the user ID and password:
jdbc:eek:racle:thin:userid/password@host:port:dbname
Specifying properties when connecting to jConnect
If you plan to use the blob data type in PowerBuilder, you should be aware that jConnect imposes a restriction on blob size. Consequently, before you make your database connection from PowerBuilder, you may want to reset the blob size to a value greater than the maximum size you plan to use.
To set blob size, define the jConnect property SQLINITSTRING in the Driver-Specific Properties box on the Connection tab. The SQLINITSTRING property is used to define commands to be passed to the backend database server.
SQLINITSTRING=set TextSize 32000;
Remember that if you define a property in the Driver-Specific Properties box, you must also define the user ID and password in this box.
Chapter 4
Using the OLE DB interface
About this chapter
This chapter describes the OLE DB interface and then explains how to prepare to use this interface and how to define the OLE DB database profile.
For more information
This chapter gives general information about using the OLE DB interface. For more detailed information:
lSee Microsoft’s Universal Data Access website (lUse the online Help provided by the data provider vendor.
lCheck to see if there is a FaxLine document that describes how to connect to your OLE DB data provider. Any updated information about connectivity issues is available from the Sybase Customer Service and Support website (support.sybase.com).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top