Extension SDK 10.1.2

oracle.jdeveloper.cm.ds.db
Class DatabaseFactory

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.DatabaseFactory

public abstract class DatabaseFactory
extends java.lang.Object

DatabaseFactory classes are responsible for creating new instances of the Database interface.

Since:
9.0.2

Constructor Summary
protected DatabaseFactory()
           
 
Method Summary
static Database createDatabase(java.sql.Connection conn)
          Creates an instance of Database for the specified Connection.
static Database createDatabase(java.lang.String connName)
           
static Database createDatabase(java.lang.String connName, java.sql.Connection conn)
           
protected abstract  Database createDatabaseImpl(java.lang.String connName, java.sql.Connection conn)
          Creates a new Database instance.
static java.sql.Connection getConnection(java.lang.String connName)
          Resolves a connection name into a Connection.
static void registerDatabaseFactory(DatabaseFactory factory)
          Registers a new DatabaseFactory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseFactory

protected DatabaseFactory()
Method Detail

createDatabaseImpl

protected abstract Database createDatabaseImpl(java.lang.String connName,
                                               java.sql.Connection conn)
Creates a new Database instance.

Parameters:
connName - a String containing the ConnectionManager name for the connection
conn - the connection to the database
Returns:
a Database representing the specified connection, or null if this DatabaseFactory does not support the connection

registerDatabaseFactory

public static final void registerDatabaseFactory(DatabaseFactory factory)
Registers a new DatabaseFactory instance.

Parameters:
factory - the DatabaseFactory instance to register.

createDatabase

public static final Database createDatabase(java.sql.Connection conn)
                                     throws CMException
Creates an instance of Database for the specified Connection.

Parameters:
conn - The Connection used when creating a Database wrapper class
Returns:
Database instance or null if one can not be created
Throws:
CMException

createDatabase

public static final Database createDatabase(java.lang.String connName)
                                     throws CMException
Throws:
CMException

createDatabase

public static final Database createDatabase(java.lang.String connName,
                                            java.sql.Connection conn)
                                     throws CMException
Throws:
CMException

getConnection

public static final java.sql.Connection getConnection(java.lang.String connName)
                                               throws CMException
Resolves a connection name into a Connection.

Parameters:
connName - The name of the connection
Returns:
A new Connection to the named database
Throws:
CMException - if an error is encountered creating the connection

Extension SDK

 

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