Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.jdeveloper.db.adapter
Class DatabaseProvider

java.lang.Object
  extended by oracle.jdeveloper.db.adapter.DatabaseProvider
All Implemented Interfaces:
java.sql.Wrapper, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.DataSource

public class DatabaseProvider
extends java.lang.Object
implements javax.naming.Referenceable, javax.sql.DataSource

Connection Provider implementation for Database Connections.


Field Summary
static java.lang.String ALL_SCHEMAS_REFTYPE
          Deprecated. with no replacement.
static java.lang.String CUSTOM_URL_CLASS_REFTYPE
          The URL for the database connection.
static java.lang.String DEPLOY_PASSWORD_CLASS_REFTYPE
          Whether to deploy the password to the runtime with the rest of the connection details.
static java.lang.String DRIVER_CLASS_REFTYPE
          The JDBC driver class.
static java.lang.String DSN_CLASS_REFTYPE
          The source name of the database.
static java.lang.String HOSTNAME_CLASS_REFTYPE
          The hostname of the database machine.
static java.lang.String INSTANCE_CLASS_REFTYPE
          The instance name of the database.
static java.lang.String PARAMETERS_CLASS_REFTYPE
          Extra parameters for the JDBC driver.
static java.lang.String PASSWORD_CLASS_REFTYPE
          The database password.
static java.lang.String PORT_CLASS_REFTYPE
          The network port the database is running on.
static java.lang.String ROLE_CLASS_REFTYPE
          The database roles to associated with the connection session.
static java.lang.String SAVE_PASSWORD_CLASS_REFTYPE
          Whether to persist the password with the connection details.
static java.lang.String SERVICENAME_CLASS_REFTYPE
          The service name of the database (Oracle).
static java.lang.String SID_CLASS_REFTYPE
          The SID name of the database (Oracle).
static java.lang.String SUBTYPE_CLASS_REFTYPE
          The subtype of the dataabase connection.
static java.lang.String USERNAME_CLASS_REFTYPE
          The database username.
 
Constructor Summary
DatabaseProvider()
          Creates an empty DatabaseProvider.
DatabaseProvider(java.util.Properties props)
          Creates a new DatabaseProvider using the given properties.
DatabaseProvider(java.lang.String name, java.util.Properties props)
          Creates a new DatabaseProvider using the given properties and with the given name.
 
Method Summary
 void disconnect()
          Notifies this provider that the connection(s) associated with it have been closed.
 boolean equals(java.lang.Object obj)
           
 javax.naming.directory.Attributes getAttributes()
           
 java.sql.Connection getConnection()
           
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
           
 java.lang.String getConnectionURL()
           
 java.lang.String getDriverClassName()
           
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
 java.util.Properties getProperties()
          Returns a copy of the underlying properties for this provider.
 java.lang.String getProperty(java.lang.String name)
          Returns the value for the specified property on this provider.
 javax.naming.Reference getReference()
           
 int hashCode()
           
 boolean isWrapperFor(java.lang.Class<?> iface)
           
static void registerConnectionCreator(java.lang.String subtype, ConnectionCreator creator)
          Registers a ConnectionCreator implementation for a new connection subtype.
static void setClassLoaderFactory(DatabaseProviderClassLoaderFactory factory)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(java.io.PrintWriter out)
           
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the given property on this provider.
<T> T
unwrap(java.lang.Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBTYPE_CLASS_REFTYPE

public static final java.lang.String SUBTYPE_CLASS_REFTYPE
The subtype of the dataabase connection.

See Also:
Constant Field Values

CUSTOM_URL_CLASS_REFTYPE

public static final java.lang.String CUSTOM_URL_CLASS_REFTYPE
The URL for the database connection. If set, this overrides all other properties like hostname.

See Also:
Constant Field Values

DRIVER_CLASS_REFTYPE

public static final java.lang.String DRIVER_CLASS_REFTYPE
The JDBC driver class. Some connections do not require this to be set because it is implicity from the connection subtype (e.g. Oracle)

See Also:
Constant Field Values

USERNAME_CLASS_REFTYPE

public static final java.lang.String USERNAME_CLASS_REFTYPE
The database username.

See Also:
Constant Field Values

PASSWORD_CLASS_REFTYPE

public static final java.lang.String PASSWORD_CLASS_REFTYPE
The database password.

See Also:
Constant Field Values

ROLE_CLASS_REFTYPE

public static final java.lang.String ROLE_CLASS_REFTYPE
The database roles to associated with the connection session.

See Also:
Constant Field Values

HOSTNAME_CLASS_REFTYPE

public static final java.lang.String HOSTNAME_CLASS_REFTYPE
The hostname of the database machine.

See Also:
Constant Field Values

PORT_CLASS_REFTYPE

public static final java.lang.String PORT_CLASS_REFTYPE
The network port the database is running on.

See Also:
Constant Field Values

SID_CLASS_REFTYPE

public static final java.lang.String SID_CLASS_REFTYPE
The SID name of the database (Oracle). Alternative to setting the service name.

See Also:
Constant Field Values

DSN_CLASS_REFTYPE

public static final java.lang.String DSN_CLASS_REFTYPE
The source name of the database.

See Also:
Constant Field Values

INSTANCE_CLASS_REFTYPE

public static final java.lang.String INSTANCE_CLASS_REFTYPE
The instance name of the database. ( Used by SQLServer )

See Also:
Constant Field Values

PARAMETERS_CLASS_REFTYPE

public static final java.lang.String PARAMETERS_CLASS_REFTYPE
Extra parameters for the JDBC driver.

See Also:
Constant Field Values

SERVICENAME_CLASS_REFTYPE

public static final java.lang.String SERVICENAME_CLASS_REFTYPE
The service name of the database (Oracle). Alternative to setting the SID.

See Also:
Constant Field Values

SAVE_PASSWORD_CLASS_REFTYPE

public static final java.lang.String SAVE_PASSWORD_CLASS_REFTYPE
Whether to persist the password with the connection details. If false a password prompter will be used to prompt for the password (DT only).

See Also:
Constant Field Values

DEPLOY_PASSWORD_CLASS_REFTYPE

public static final java.lang.String DEPLOY_PASSWORD_CLASS_REFTYPE
Whether to deploy the password to the runtime with the rest of the connection details.

See Also:
Constant Field Values

ALL_SCHEMAS_REFTYPE

@Deprecated
public static final java.lang.String ALL_SCHEMAS_REFTYPE
Deprecated. with no replacement.
Want to get rid of this property. Multiple schemas should be treated in the same way as all the other navs.

See Also:
Constant Field Values
Constructor Detail

DatabaseProvider

public DatabaseProvider()
Creates an empty DatabaseProvider.


DatabaseProvider

public DatabaseProvider(java.util.Properties props)
Creates a new DatabaseProvider using the given properties.


DatabaseProvider

public DatabaseProvider(java.lang.String name,
                        java.util.Properties props)
Creates a new DatabaseProvider using the given properties and with the given name.

Method Detail

getReference

public javax.naming.Reference getReference()
Specified by:
getReference in interface javax.naming.Referenceable

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws java.sql.SQLException
Specified by:
setLogWriter in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws java.sql.SQLException
Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns the value for the specified property on this provider.


getProperties

public java.util.Properties getProperties()
Returns a copy of the underlying properties for this provider.


setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Sets the given property on this provider.


disconnect

public void disconnect()
Notifies this provider that the connection(s) associated with it have been closed. Removes any cached passwords.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getConnectionURL

public java.lang.String getConnectionURL()
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getDriverClassName

public java.lang.String getDriverClassName()
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getAttributes

public javax.naming.directory.Attributes getAttributes()

setClassLoaderFactory

public static void setClassLoaderFactory(DatabaseProviderClassLoaderFactory factory)

registerConnectionCreator

public static void registerConnectionCreator(java.lang.String subtype,
                                             ConnectionCreator creator)
Registers a ConnectionCreator implementation for a new connection subtype.

Parameters:
subtype - the subtype for the connection
creator - the creator responsible for creating connections of the given subtype.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.