Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.sql
Class DriverManager

java.lang.Object
  extended by oracle.adfnmc.java.sql.DriverManager

public class DriverManager
extends java.lang.Object


Field Summary
static java.lang.Class CLASS_INSTANCE
           
static java.lang.String CREATEIFMISSING_PROPERTY
           
static java.lang.String PASSWORD_PROPERTY
           
static java.lang.String READONLY_PROPERTY
           
static java.lang.String SHAREDCACHE_PROPERTY
           
static java.lang.String SQLITE_DRIVER_NAME
           
static java.lang.String USER_PROPERTY
           
 
Constructor Summary
DriverManager()
           
 
Method Summary
static void deregisterDriver(Driver driver)
          Removes a driver from the DriverManager's registered driver list.
static Connection getConnection(java.lang.String url)
          Attempts to establish a connection to the given database URL.
static Connection getConnection(java.lang.String url, Properties info)
          Attempts to establish a connection to the given database URL.
static Connection getConnection(java.lang.String url, java.lang.String user, java.lang.String password)
          Attempts to establish a connection to the given database URL.
static void registerDriver(Driver driver)
          Registers a given JDBC driver with the DriverManager.
static void setLogWriter(PrintWriter out)
          Sets the PrintWriter that will be used by all loaded drivers, and also the DriverManager.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

SQLITE_DRIVER_NAME

public static final java.lang.String SQLITE_DRIVER_NAME
See Also:
Constant Field Values

USER_PROPERTY

public static final java.lang.String USER_PROPERTY
See Also:
Constant Field Values

PASSWORD_PROPERTY

public static final java.lang.String PASSWORD_PROPERTY
See Also:
Constant Field Values

CREATEIFMISSING_PROPERTY

public static final java.lang.String CREATEIFMISSING_PROPERTY
See Also:
Constant Field Values

SHAREDCACHE_PROPERTY

public static final java.lang.String SHAREDCACHE_PROPERTY
See Also:
Constant Field Values

READONLY_PROPERTY

public static final java.lang.String READONLY_PROPERTY
See Also:
Constant Field Values
Constructor Detail

DriverManager

public DriverManager()
Method Detail

registerDriver

public static void registerDriver(Driver driver)
                           throws SQLException
Registers a given JDBC driver with the DriverManager.

A newly loaded JDBC driver class should register itself with the DriverManager by calling this method.

Parameters:
driver - the Driver to register with the DriverManager
Throws:
SQLException - if a database access error occurs.

deregisterDriver

public static void deregisterDriver(Driver driver)
                             throws SQLException
Removes a driver from the DriverManager's registered driver list. This will only succeed where the caller's classloader loaded the driver that is to be removed. If the driver was loaded by a different classloader, the removal of the driver will fail silently.

If the removal succeeds, the DriverManager will not in future use this driver when asked to get a Connection.

Parameters:
driver -
Throws:
SQLException - if there is an exception accessing the database.

getConnection

public static Connection getConnection(java.lang.String url)
                                throws SQLException
Attempts to establish a connection to the given database URL.

Parameters:
url - a URL string representing the database target to connect with
Returns:
a Connection to the database identified by the URL. null if no connection can be made.
Throws:
SQLException - if there is an error while attempting to connect to the database identified by the URL

getConnection

public static Connection getConnection(java.lang.String url,
                                       Properties info)
                                throws SQLException
Attempts to establish a connection to the given database URL.

Parameters:
url - a URL string representing the database target to connect with
info - a set of Properties to use as arguments to set up the connection. Properties are arbitrary string/value pairs. Normally, at least the properties "user" and "password" should be passed, with appropriate settings for the userid and its corresponding password to get access to the database concerned.
Returns:
a Connection to the database identified by the URL. null if no connection can be made.
Throws:
SQLException - if there is an error while attempting to connect to the database identified by the URL

getConnection

public static Connection getConnection(java.lang.String url,
                                       java.lang.String user,
                                       java.lang.String password)
                                throws SQLException
Attempts to establish a connection to the given database URL.

Parameters:
url - a URL string representing the database target to connect with
user - a userid used to login to the database
password - a password for the userid to login to the database
Returns:
a Connection to the database identified by the URL. null if no connection can be made.
Throws:
SQLException - if there is an error while attempting to connect to the database identified by the URL

setLogWriter

public static void setLogWriter(PrintWriter out)
Sets the PrintWriter that will be used by all loaded drivers, and also the DriverManager.

Parameters:
out - the PrintWriter to be used

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.