1/12
Contents
Title and Copyright Information
Preface
Documentation Accessibility
Conventions
1
Introduction and Roadmap
Document Scope and Audience
Guide to this Document
Related Documentation
JDBC Samples and Tutorials
Avitek Medical Records Application (MedRec)
JDBC Examples in the WebLogic Server Distribution
New and Changed Features in This Release
Oracle Type 4 JDBC drivers from DataDirect
Secure RMI Driver Communication
Deprecations
2
Using WebLogic JDBC in an Application
Getting a Database Connection from a DataSource Object
Importing Packages to Access DataSource Objects
Obtaining a Client Connection Using a DataSource
Possible Exceptions When a Connection Request Fails
Pooled Connection Limitation
Getting a Connection from an Application-Scoped Data Source
3
Performance Tuning Your JDBC Application
WebLogic Performance-Enhancing Features
How Pooled Connections Enhance Performance
Caching Statements and Data
Designing Your Application for Best Performance
Process as Much Data as Possible Inside the Database
Use Built-in DBMS Set-based Processing
Make Your Queries Smart
Make Transactions Single-batch
Never Have a DBMS Transaction Span User Input
Use In-place Updates
Keep Operational Data Sets Small
Use Pipelining and Parallelism
4
Using WebLogic-branded DataDirect Drivers
Using DataDirect Documentation
JDBC Specification Compliance
Installation
Supported Drivers and Databases
Connecting Through WebLogic JDBC Data Sources
Developing Your Own JDBC Code
Specifying Connection Properties
Using IP Addresses
Required Permissions for the Java Security Manager
For MS SQLServer Users
Installing MS SQLServer XA DLLs
Using instjdbc.sql with MS SQLServer
5
Using WebLogic Wrapper Drivers
Using the WebLogic RMI Driver (Deprecated)
RMI Driver Client Interoperability
Security Considerations for WebLogic RMI Drivers
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
Limitations When Using Global Transactions
Using the WebLogic JTS Driver (Deprecated)
Sample Client Code for Using the JTS Driver
Using the WebLogic Pool Driver (Deprecated)
6
Using API Extensions in JDBC Drivers
Using API Extensions to JDBC Interfaces
Sample Code for Accessing API Extensions to JDBC Interfaces
Import Packages to Access API Extensions
Get a Connection
Cast the Connection as a Vendor Connection
Use API Extensions
Using API Extensions for Oracle JDBC Types
Using Deprecated API Extensions with the Oracle Thin Driver
Special Considerations When Using Oracle Thin Driver Extensions
Sample Code for Accessing Oracle Thin Driver Extensions to JDBC Interfaces
Programming with ARRAYs
Import Packages to Access WebLogic Oracle Extensions
Establish the Connection
Getting an ARRAY
Updating ARRAYs in the Database
Using Oracle Array Extension Methods
Programming with STRUCTs
Getting a STRUCT
Using WebLogic 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 WebLogic OracleRef Extension Methods
Getting a Value
Updating REF Values
Creating a REF in the Database
Programming with Large Objects
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
Transaction Boundaries Using LOBs
Recovering LOB Space
Support for API Extensions Between Versions of WebLogic Server Clients and Servers
Tables of Oracle Thin Driver Extension Interfaces and Supported Methods
Using Batching with the Oracle Thin Driver
Programming with Oracle Virtual Private Databases
Oracle VPD with WebLogic Server
7
Getting a Physical Connection from a Data Source
Opening a Connection
Closing a Connection
Remove Infected Connections Enabled is True
Remove Infected Connections Enabled is False
Limitations for Using a Physical Connection
8
Using RowSets with WebLogic Server
About RowSets
Types of RowSets
Programming with RowSets
CachedRowSets
Characteristics
Special Programming Considerations and Limitations for CachedRowSets
Entire RowSet Query Results Stored in Memory
Data Contention
Code Example
Importing Classes and Interfaces for a CachedRowSet
Creating a CachedRowSet
Setting CachedRowSet Properties
Database Connection Options
Populating a CachedRowSet
Setting CachedRowSet MetaData
Working with Data in a CachedRowSet
Getting Data from a Row in a RowSet
Updating a Row in a RowSet
Inserting a Row in a RowSet
Deleting a Row in a RowSet
Synchronizing RowSet Changes with the Database
RowSet MetaData Settings for Database Updates
WebLogic RowSet Extensions for Working with MetaData
executeAndGuessTableName and executeAndGuessTableNameAndPrimaryKeys
Setting Table and Primary Key Information Using the MetaData Interface
Setting the Write Table
RowSets and Transactions
Integrating with JTA Global Transactions
Behavior of Rowsets Using Global Transactions
Using Local Transactions
Behavior of Rowsets Using Local Transactions
Reusing a WebLogic RowSet After Completing a Transaction
FilteredRowSets
FilteredRowSet Characteristics
Special Programming Considerations
RowSet Filters are Not Cumulative
No Pending Changes Before Setting or Changing a Filter
FilteredRowSet Code Example
Importing Classes and Interfaces for FilteredRowSets
Creating a FilteredRowSet
Setting FilteredRowSet Properties
Database Connection Options for a FilteredRowSet
Populating a FilteredRowSet
Setting FilteredRowSet MetaData
Setting the Filter for a FilteredRowSet
User-Defined RowSet Filter
WebLogic SQL-Style Filter
Working with Data in a FilteredRowSet
WebRowSets
Special Programming Considerations
JoinRowSets
JDBCRowSets
Handling SyncProviderExceptions with a SyncResolver
RowSet Data Synchronization Conflict Types
SyncResolver Code Example
Getting a SyncResolver Object
Navigating in a SyncResolver Object
Setting the Resolved Value for a RowSet Data Synchronization Conflict
Synchronizing Changes
WLCachedRowSets
SharedRowSets
SortedRowSets
SQLPredicate, a SQL-Style RowSet Filter
What is SQLPredicate?
SQLPredicate Grammar
Code Example
Optimistic Concurrency Policies
VERIFY_READ_COLUMNS
VERIFY_MODIFIED_COLUMNS
VERIFY_SELECTED_COLUMNS
VERIFY_NONE
VERIFY_AUTO_VERSION_COLUMNS
VERIFY_VERSION_COLUMNS
Optimistic Concurrency Control Limitations
Choosing an Optimistic Policy
Performance Options
JDBC Batching
Batching Limitations with and Oracle Database
Group Deletes
9
Troubleshooting JDBC
Problems with Oracle Database on UNIX
Thread-related Problems on UNIX
Closing JDBC Objects
Abandoning JDBC Objects
Using Microsoft SQL Server with Nested Triggers
Exceeding the Nesting Level
Using Triggers and EJBs
Scripting on this page enhances content navigation, but does not change the content in any way.