BEA WebLogic Enterprise 4.2    Developer Center     

        HOME   |   SITE MAP   |   SEARCH   |   CONTACT   |   GLOSSARY  |   PDF FILES |   WHAT'S NEW 
 
        DEVELOPING APPLICATIONS    |   TABLE OF CONTENTS   |   PREVIOUS TOPIC   |   INDEX 

Extensions to the JDBC API


This chapter describes the following jdbcKona extensions to the JDBC API:

For complete details on the JDBC API, refer to the following Web site:

http://www.weblogic.com/docs/classdocs/packages.html#jdbc

Class CallableStatement

Class weblogic.jdbc.oci.CallableStatement contains jdbcKona extensions to JDBC to support the use of cursors as parameters in CallableStatement objects.

The CallableStatement class:

weblogic.jdbc.oci.CallableStatement.getResultSet

Synopsis

Returns a ResultSet object from a stored procedure where the specified parameter has been bound to an Oracle cursor. Register the output parameter with the registerOutputParameter method, using java.sql.Types.OTHER as the data type.

Java Mapping

public ResultSet getResultSet(int parameterIndex) throws                                                                                                     SQLException

Parameters

parameterIndex
This parameter is an index into the set of parameters for the stored procedure.

Throws

SQLException
This exception is thrown if the operation cannot be completed.

Class Connection

This section describes only the jdbcKona extension to JDBC that accesses the Oracle OCI C Function oopt(). Other information about this class is in the description for class java.sql.Connection. A Connection object is usually constructed as a java.sql.Connection class. To use this extension to JDBC, you must explicitly cast your Connection object as a weblogic.jdbc.oci.Connection class.

The public Connection class:

weblogic.jdbc.oci.Connection.waitOnResources

Synopsis

Use this method to access the Oracle oopt() function for C (see section 4-97 of The OCI Functions for C). The Oracle C function sets options in cases where requested resources are not available; for example, whether to wait for locks.

When the argument to this method is true, this jdbcKona extension to JDBC sets this option so that your program will receive an error return code whenever a resource is requested but is unavailable. Use of this method can cause several error return codes while waiting for internal resources that are locked for short durations.

Java Mapping

public void waitOnResources(boolean val)

Parameters

val
This parameter is set to true if the connection should wait on resources.

Class weblogic.jdbc.oci.Statement

This class contains jdbcKona extensions to JDBC to support parsing of SQL statements and adjusting of the fetch size. Only those methods are documented here.

The weblogic.jdbc.oci.Statement class:

weblogic.jdbc.oci.Statement.fetchsize

Synopsis

Allows tuning of the size of prefetch array used for Oracle row results. Oracle provides the means to do data prefetch in batches, which decreases network traffic and latency for row requests.

The default batch size is 100. Memory for 100 rows is allocated in the native stack for every query. For queries that need fewer rows, this size can be adjusted appropriately. This saves on the swappable image size of the application and will benefit performance if only as many rows as needed are fetched.

Java Mapping

public void fetchSize(int size)

Parameters

size
This parameter specifies the number of rows to be prefetched.

weblogic.jdbc.oci.Statement.parse

Synopsis

Allows tuning of the size of prefetch array used for Oracle row results. Oracle provides the means to do data prefetch in batches, which decreases network traffic and latency for row requests.

The default batch size is 100. Memory for 100 rows is allocated in the native stack for every query. For queries that need fewer rows, this size can be adjusted appropriately. This saves on the swappable image size of the application and will benefit performance if only as many rows as needed are fetched.

Java Mapping

public int parse(String sql) throws SQLException

Parameters

sql
This parameter is the SQL statement to be verified.

Throws

SQLException
This exception is thrown if the operation cannot be completed.


Copyright © 1999 BEA Systems, Inc. All Rights Reserved.
Required browser version: Netscape Communicator version 4.0 or higher, or Microsoft Internet Explorer version 4.0 or higher.
Last update: July 01, 1999.