BEA Logo BEA WebLogic Server Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

Using WebLogic JDBC with Sybase PowerJ

Contents
Before you begin
Setting up PowerJ with WebLogic JDBC
Using expanded URLs

Before you begin

WebLogic's two-tier jdbcKona drivers work transparently with Sybase's PowerJ development environment. (Just add the appropriate directories and jar files to your PowerJ CLASSPATH.) This document contains information about using WebLogic's multitier WebLogic JDBC, the pure-Java JDBC driver, for database access with PowerJ.

You must develop in a JDK-1.1 environment with PowerJ and the WebLogic JDBC driver, using the java.sql classes, rather than PowerJ's jdbc.* package, which was made available in the PowerJ version that supported JDK 1.0.2.

To use PowerJ with WebLogic JDBC, you will need to use:

  • java.sql.* for your JDBC Connections
  • An expanded URL for connecting to the WebLogic Server

Setting up PowerJ with WebLogic JDBC

Here are a few tips for configuring and using WebLogic's multitier WebLogic JDBC with PowerSoft's PowerJ development environment. To set up PowerJ for use with WebLogic JDBC follow these steps:
  1. Copy the WebLogic classes into:
    Powersoft\PowerJ20\Java\User Classes\jdk11\lib

  2. Start PowerJ. In Toolbars under the View menu, select Manual Configuration, then deselect the JDK102 toolbar. Select the JDK (1.1) toolbar. Close the open project.

  3. In Options under the Tools menu, select the Startup tab and change the default type of project to one of the 1.1 options.

  4. Create a new project under the File menu. Select the Database toolbar tab, select the transaction bean and drag it into the application.

  5. Double-click the transaction and choose the Connection tab. Enter "weblogic.jdbc.t3.Driver" as the database driver name.

  6. Enter the appropriate URL and then your username and password for the database you will be using. (See below for more on expanded URLs.)

  7. Check under the JDBC tab to confirm that the JavaSqlPackage is selected.

  8. Make sure that the WebLogic Server and your database are running, then test your connection.

Using expanded URLs

PowerSoft's PowerJ Java development environment requires the use of an expanded URL when creating a WebLogic JDBC Connection. In the PowerJ development environment, the Properties object is used exclusively for username and database, whereas WebLogic customarily uses the Properties object to set other properties for connection, and passes a second Properties object that sets properties for the multitier connection.

This restriction means that you must use the URL passed as the first argument to the DriverManager.getConnection() method -- more often used just to identify the driver -- to set all of the other parameters required for a WebLogic JDBC connection, including the servername and all of the weblogic.t3 properties. (For more information about setting properties for a WebLogic JDBC Connection, see the Developers Guide Using WebLogic JDBC.) In this expanded URL, you can use to supply all of the information needed for a multitier connection.

The structure of the URL is:

  • The URL of the WebLogic JDBC driver ("jdbc:weblogic:t3")
  • A question-mark (?), which separates the driver URL from the following arguments
  • A series of name-value pairs, each separated by an ampersand (&), that describe more properties

Here is a sample URL:

  jdbc:weblogic:t3?
  weblogic.t3.serverURL=t3://toyboat.bigbox.com:7001&
  weblogic.t3.driverClassName=weblogic.jdbc.oci.Driver&
  weblogic.t3.driverURL=jdbc:weblogic:oracle:DEMO&
  weblogic.t3.cacheRows=25

The working URL is a single, unbroken string that is shown here on multiple lines for clarity.

For more information on the syntax for expanded URLs, see Using URLs with WebLogic products.

In most cases, you will not ever need to specify that you want to use java.sql.* -- that will be done for you. If for some reason you want to create your own T3Client, you would set the following property in the WebLogic URL, an argument used when you create the T3Client:

  usexjava=false
in the constructor for the T3Client, as shown in this example:
  T3Client t3 =
     new T3Client("t3://toyboat.bigbox.com:7001?usexjava=false");

 

Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
Last updated 01/13/1999