org.geotools.data.oracle
Class OracleConnectionFactory

java.lang.Object
  extended byorg.geotools.data.oracle.OracleConnectionFactory

public class OracleConnectionFactory
extends java.lang.Object

Provides javax.sql.DataSource wrapper around an OracleConnection object.

Version:
$Id: OracleConnectionFactory.java 17700 2006-01-22 23:30:39Z desruisseaux $
Author:
Sean Geoghegan, Defence Science and Technology Organisation, $Author: seangeo $

Constructor Summary
OracleConnectionFactory(java.lang.String alias)
          BDT ADDED 2004/08/02 This constructor sets up a connection factor for OCI connection.
OracleConnectionFactory(java.lang.String host, java.lang.String port, java.lang.String instance)
          Creates a new OracleConnection object that wraps a oracle.jdbc.driver.OracleConnection.
 
Method Summary
 ConnectionPool getConnectionPool()
          Creates the real OracleConnection.
 ConnectionPool getConnectionPool(java.lang.String user, java.lang.String pass)
          Creates the real OracleConnection.
 void setLogin(java.lang.String user, java.lang.String pass)
          Sets the login credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleConnectionFactory

public OracleConnectionFactory(java.lang.String alias)
BDT ADDED 2004/08/02 This constructor sets up a connection factor for OCI connection. The alias refers to values defined by Oracle Net Configuration assitant and stored in $ORACLE_HOME/network/admin/tnsnames.ora OCI connection require you to install the oracle client software. The classes12.jar MUST be taken from $ORACLE_HOME/jdbc/lib Creates a new OracleConnection object that wraps a oracle.jdbc.driver.OracleConnection.

Parameters:
alias - The host to connect to.

OracleConnectionFactory

public OracleConnectionFactory(java.lang.String host,
                               java.lang.String port,
                               java.lang.String instance)
Creates a new OracleConnection object that wraps a oracle.jdbc.driver.OracleConnection.

Parameters:
host - The host to connect to.
port - The port number on the host
instance - The instance name on the host
Method Detail

getConnectionPool

public ConnectionPool getConnectionPool(java.lang.String user,
                                        java.lang.String pass)
                                 throws java.sql.SQLException
Creates the real OracleConnection. Logs in to the Oracle Database and creates the OracleConnection object.

Parameters:
user - The user name.
pass - The password
Returns:
The real OracleConnection object.
Throws:
java.sql.SQLException - If an error occurs connecting to the DB.

getConnectionPool

public ConnectionPool getConnectionPool()
                                 throws java.sql.SQLException
Creates the real OracleConnection. Logs into the database using the credentials provided by setLogin

Returns:
The oracle connection to the data base.
Throws:
java.sql.SQLException - If an error occurs connecting to the DB.

setLogin

public void setLogin(java.lang.String user,
                     java.lang.String pass)
Sets the login credentials.

Parameters:
user - The username
pass - The password


Copyright © GeoTools. All Rights Reserved.