Programming WebLogic JDBC

 Previous Next Contents View as PDF  

Introduction to WebLogic JDBC

Overview of JDBC

Using JDBC Drivers with WebLogic Server

Types of JDBC Drivers

Table of WebLogic Server JDBC Drivers

WebLogic Server JDBC Two-Tier Drivers

WebLogic jDriver for Oracle

WebLogic jDriver for Microsoft SQL Server

WebLogic Server JDBC Multitier Drivers

WebLogic RMI Driver

WebLogic Pool Driver

WebLogic JTS Driver

Third-Party Drivers

Sybase jConnect Driver

Oracle Thin Driver

Overview of Connection Pools

Using Connection Pools with Server-side Applications

Using Connection Pools with Client-side Applications

Overview of MultiPools

Overview of Clustered JDBC

Overview of DataSources

JDBC API

JDBC 2.0

Platforms

Configuring and Administering WebLogic JDBC

Configuring and Using Connection Pools

Advantages to Using Connection Pools

Creating a Connection Pool at Startup

Avoiding Server Lockup with the Correct Number of Connections

Database Passwords in Connection Pool Configuration

Connection Pool Limitation

Notes About Refreshing Connections in a JDBC Connection Pool

JDBC Connection Pool Testing Enhancements

Minimizing Connection Test Delay After Database Connectivity Loss

Minimizing Connection Request Delay After Connection Test Failures

Minimizing Connection Request Delay with SecondsToTrustAnIdlePoolConnection

Creating a Connection Pool Dynamically

Dynamic Connection Pool Sample Code

Import Packages

Look Up the Administration MBeanHome

Get the Server MBean

Create the Connection Pool MBean

Set the Connection Pool Properties

Add the Target

Create a DataSource

Removing a Dynamic Connection Pool and DataSource

Managing Connection Pools

Retrieving Information About a Pool

Disabling a Connection Pool

Shrinking a Connection Pool

Shutting Down a Connection Pool

Resetting a Pool

Using weblogic.jdbc.common.JdbcServices and weblogic.jdbc.common.Pool Classes (Deprecated)

Application-Scoped JDBC Connection Pools

Configuring and Using MultiPools

MultiPool Features

Choosing the MultiPool Algorithm

High Availability

Load Balancing

MultiPool Failover Enhancements

Connection Request Routing Enhancements When a Connection Pool Fails

Automatic Re-enablement on Recovery of a Failed Connection Pool within a MultiPool

Enabling Failover for Busy Connection Pools in a MultiPool

Controlling MultiPool Failover with a Callback

Controlling MultiPool Failback with a Callback

MultiPool Fail-Over Limitations and Requirements

Test Connections on Reserve to Enable Fail-Over

No Fail-Over for In-Use Connections

Configuring and Using DataSources

Importing Packages to Access DataSource Objects

Obtaining a Client Connection Using a DataSource

Code Examples

JDBC Data Source Factories

Performance Tuning Your JDBC Application

Overview of JDBC Performance

WebLogic Performance-Enhancing Features

How Connection Pools Enhance Performance

Caching Prepared Statements and Data

Designing Your Application for Best Performance

1. Process as Much Data as Possible Inside the Database

2. Use Built-in DBMS Set-based Processing

3. Make Your Queries Smart

4. Make Transactions Single-batch

5. Never Have a DBMS Transaction Span User Input

6. Use In-place Updates

7. Keep Operational Data Sets Small

8. Use Pipelining and Parallelism

Using WebLogic Multitier JDBC Drivers

Using the WebLogic RMI Driver

Setting Up WebLogic Server to Use the WebLogic RMI Driver

Sample Client Code for Using the RMI Driver

Import the Required Packages

Get the Database Connection

Using a JNDI Lookup to Obtain the Connection

Using Only the WebLogic RMI Driver to Obtain a Database Connection

Row Caching with the WebLogic RMI Driver

Important Limitations for Row Caching with the WebLogic RMI Driver

Using the WebLogic JTS Driver

Sample Client Code for Using the JTS Driver

Using the WebLogic Pool Driver

Using Third-Party Drivers with WebLogic Server

Overview of Third-Party JDBC Drivers

Setting the Environment for Your Third-Party JDBC Driver

CLASSPATH for Third-Party JDBC Driver on Windows

CLASSPATH for Third-Party JDBC Driver on UNIX

Changing or Updating the Oracle Thin Driver

Package Change for Oracle Thin Driver 9.x and 10g

Character Set Support with nls_charset12.zip

Updating Sybase jConnect Driver

Installing and Using the IBM Informix JDBC Driver

Connection Pool Attributes when using the IBM Informix JDBC Driver

Programming Notes for the IBM Informix JDBC Driver

Installing and Using the SQL Server 2000 Driver for JDBC from Microsoft

Installing the MS SQL Server JDBC Driver on a Windows System

Installing the MS SQL Server JDBC Driver on a Unix System

Connection Pool Attributes when using the Microsoft SQL Server Driver for JDBC

Getting a Connection with Your Third-Party Driver

Using Connection Pools with a Third-Party Driver

Creating the Connection Pool and DataSource

Using a JNDI Lookup to Obtain the Connection

Getting a Physical Connection from a Connection Pool

Code Sample for Getting a Physical Connection

Limitations for Using a Physical Connection

Using Oracle Extensions with the Oracle Thin Driver

Limitations When Using Oracle JDBC Extensions

Sample Code for Accessing Oracle Extensions to JDBC Interfaces

Import Packages to Access Oracle Extensions

Establish the Connection

Retrieve the Default Row Prefetch Value

Programming with ARRAYs

Getting an ARRAY

Updating ARRAYs in the Database

Using Oracle Array Extension Methods

Programming with STRUCTs

Getting a STRUCT

Using OracleStruct Extension Methods

Getting STRUCT Attributes

Using STRUCTs to Update Objects in the Database

Creating Objects in the Database

Automatic Buffering for STRUCT Attributes

Programming with REFs

Getting a REF

Using OracleRef Extension Methods

Getting a Value

Updating REF Values

Creating a REF in the Database

Programming with BLOBs and CLOBs

Query to Select BLOB Locator from the DBMS

Declare the WebLogic Server java.sql Objects

Begin SQL Exception Block

Updating a CLOB Value Using a Prepared Statement

Programming with Oracle Virtual Private Databases

Tables of Oracle Extension Interfaces and Supported Methods

Using dbKona (Deprecated)

Overview of dbKona

dbKona in a Multitier Configuration

How dbKona and a JDBC Driver Interact

How dbKona and WebLogic Events Can interact

The dbKona Architecture

The dbKona API

The dbKona API Reference

The dbKona Objects and Their Classes

Data Container Objects in dbKona

DataSet

QueryDataSet

TableDataSet

EventfulTableDataSet (Deprecated)

Record

Value

Data Description Objects in dbKona

Schema

Column

KeyDef

SelectStmt

Miscellaneous Objects in dbKona

Exceptions

Constants

Entity Relationships

Inheritance Relationships

Possession Relationships

Implementing dbKona

Accessing a DBMS with dbKona

Step 1. Import packages

Step 2. Set Properties for Making a Connection

Step 3. Make a Connection to the DBMS

Preparing a Query, Retrieving, and Displaying Data

Step 1. Set Parameters for Data Retrieval

Step 2. Create a DataSet for the Query Results

Step 3. Fetch the Results

Step 4. Examine a TableDataSet's Schema

Step 5. Examine the Data with htmlKona

Step 6. Display the Results with htmlKona

Step 7. Close the DataSet and the Connection

Using a SelectStmt Object to Form a Query

Step 1. Setting SelectStmt Parameters

Step 2. Using QBE to Refine the Parameters

Modifying DBMS Data with a SQL Statement

Step 1. Writing SQL Statements

Step 1. Writing SQL statements

Step 2. Executing Each SQL Statement

Step 3. Displaying the Results with htmlKona

Modifying DBMS Data with a KeyDef

Step 1. Creating a KeyDef and Building Its Attributes

Step 2. Creating a TableDataSet with a KeyDef

Step 3. Inserting a Record into the TableDataSet

Step 4. Updating a Record in the TableDataSet

Step 5. Deleting a Record from the TableDataSet

Step 6. More on Saving the TableDataSet

Checking Record Status Before Saving

Step 7. Verifying the changes

Code Summary

Using a JDBC PreparedStatement with dbKona

Using Stored Procedures with dbKona

Step 1. Creating a Stored Procedure

Step 2. Setting parameters

Step 3. Examining the Results

Using Byte Arrays for Images and Audio

Step 1. Retrieving and Displaying Image Data

Step 2. Inserting an Image into a Database

Using dbKona for Oracle Sequences

Constructing a dbKona Sequence Object

Creating and Destroying Sequences on an Oracle Server from dbKona

Using a Sequence

Code Summary

Testing JDBC Connections and Troubleshooting

Monitoring JDBC Connectivity

Validating a DBMS Connection from the Command Line

Syntax

Arguments

Examples

Troubleshooting JDBC

JDBC Connections

Windows

UNIX

Codeset Support

Other Problems with Oracle on UNIX

Thread-related Problems on UNIX

Closing JDBC Objects

Abandoning JDBC Objects

Troubleshooting Problems with Shared Libraries on UNIX

WebLogic jDriver for Oracle

Solaris

HP-UX

Incorrectly Set File Permissions

Incorrect SHLIB_PATH

Using Mircrosoft SQL with Nested Triggers

Exceeding the Nesting Level

Using Triggers and EJBs

 

Back to Top Previous Next