Skip navigation links

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.2.1)

Part Number E55141-01
P4 Change 1723563 on 2015/10/09


weblogic.jdbc.extensions
Interface WLDataSource


public interface WLDataSource

A WLDataSource provides methods not supported by javax.sql.DataSource.

WLDataSource provides methods for the following:

See Also:
DataSource

Method Summary
abstract  Connection createConnection(Properties additionalProperties)
          Attempts to create a new database connection with the requested additional connection properties.
abstract  Connection createConnectionToInstance(String instance, Properties additionalProperties)
          Attempts to create a new database connection with the requested additional connection properties to the specified instance.
abstract  Connection getConnection(Properties labels)
          Attempts to obtain a database connection with the requested connection labels.
abstract  Connection getConnection(String username, String password, Properties labels)
          Attempts to obtain a database connection with the requested connection labels.
abstract  void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk)
          Registers a connection initialization callback with the underlying connection pool.
abstract  void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk)
          Registers a connection labeling callback with the underlying connection pool.
abstract  void removeConnectionLabelingCallback()
          Removes the ConnectionLabelingCallback object registered with the underlying connection pool, if any.
abstract  void unregisterConnectionInitializationCallback()
          Unregisters the ConnectionInitializationCallback object registered with the underlying connection pool, if any.

 

Method Detail

getConnection

Connection getConnection(Properties labels)
                         throws SQLException
Attempts to obtain a database connection with the requested connection labels.
Parameters:
labels - The requested connection labels.
Returns:
A Connection to the database.
Throws:
SQLException - if a database-access error occurs.

getConnection

Connection getConnection(String username,
                         String password,
                         Properties labels)
                         throws SQLException
Attempts to obtain a database connection with the requested connection labels.
Parameters:
username - The database user on whose behalf the connection is being made.
password - The user's password.
labels - The requested connection labels.
Returns:
A Connection to the database.
Throws:
SQLException - if a database-access error occurs.

registerConnectionLabelingCallback

void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk)
                                        throws SQLException
Registers a connection labeling callback with the underlying connection pool.
Parameters:
cbk - The ConnectionLabelingCallback object to be registered.
Throws:
SQLException - If there is a callback already registered with the pool.

removeConnectionLabelingCallback

void removeConnectionLabelingCallback()
                                      throws SQLException
Removes the ConnectionLabelingCallback object registered with the underlying connection pool, if any.
Throws:
SQLException - If callback removal fails.

registerConnectionInitializationCallback

void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk)
                                              throws SQLException
Registers a connection initialization callback with the underlying connection pool.
Parameters:
cbk - The ConnectionInitializationCallback object to be registered.
Throws:
SQLException - If there is a callback already registered with the pool.

unregisterConnectionInitializationCallback

void unregisterConnectionInitializationCallback()
                                                throws SQLException
Unregisters the ConnectionInitializationCallback object registered with the underlying connection pool, if any.
Throws:
SQLException - If callback removal fails.

createConnection

Connection createConnection(Properties additionalProperties)
                            throws SQLException
Attempts to create a new database connection with the requested additional connection properties. When the connection is closed, it will not be returned to the connection pool. This API should work on any driver, assuming that the additional connection properties that are specified can either be used or ignored by the associated driver.
Parameters:
additionalProperties - The requested additional connection properties.
Returns:
A new Connection to the database.
Throws:
SQLException - if a database-access error occurs.

createConnectionToInstance

Connection createConnectionToInstance(String instance,
                                      Properties additionalProperties)
                                      throws SQLException
Attempts to create a new database connection with the requested additional connection properties to the specified instance. When the connection is closed, it will not be returned to the connection pool. This is only supported on Active GridLink on Oracle thin driver.
Parameters:
instance - Target instance.
additionalProperties - The requested additional connection properties.
Returns:
A new Connection to the the same instance as the connection specified.
Throws:
SQLException - if a database-access error occurs.
SQLFeatureNotSupportedException - The method was invoked on an unsupported connection or driver type

Skip navigation links

Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.2.1)

Part Number E55141-01
P4 Change 1723563 on 2015/10/09