Go to main content
1/13
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
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
Using DataSource Resource Definitions
Using Java EE DataSources Resource Definitions
Creating DataSource Resource Definitions Using Annotations
Creating DataSource Resource Definition Using Deployment Descriptors
Using WebLogic Configuration Attributes
Implementation Considerations When Using DataSource Resource Definitions
Naming Conventions
WebLogic Data Source Naming Conventions
Java EE Data Source Naming Conventions
Mapping the Java EE DataSource Resource Definition to WebLogic Data Source Resources
Configuring Active GridLink DataSource Resource Definitions
Additional Considerations
Using Data Sources in Clients
Additional Resources
4
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
5
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
6
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)
7
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
Sample Code for Accessing Oracle Thin Driver Extensions to JDBC Interfaces
Programming with Arrays
Import Packages to Access Oracle Extensions
Establish the Connection
Creating an Array in the Database
Getting an Array
Updating an Array in the Database
Using Oracle Array Extension Methods
Programming with Structs
Creating Objects in the Database
Getting Struct Attributes
Using OracleStruct Extension Methods
Using a Struct to Update Objects in the Database
Programming with Refs
Creating a Ref in the Database
Getting a Ref
Using WebLogic OracleRef Extension Methods
Updating Ref Values
Programming with Large Objects
Creating Blobs in the Database
Updating Blobs in the Database
Using OracleBlob Extension Methods
Programming with Clob Values
Transaction Boundaries Using LOBs
Recovering LOB Space
Using Batching with the Oracle Thin Driver
8
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
9
Using RowSets with WebLogic Server
Deprecation of weblogic.jdbc.rowsets
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
10
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.