org.brains2b.sql
Class RemoteConnector

java.lang.Object
  extended by org.brains2b.sql.RemoteConnector
All Implemented Interfaces:
java.lang.Cloneable, Connector

public class RemoteConnector
extends java.lang.Object
implements Connector

Implementation of Connector to connect to a remote JDBC source, given by a lookup name accessable through an InitialContext

Version:
0.10.1 [26-feb-2007]
Author:
dennis@brains2b.nl

Constructor Summary
RemoteConnector(java.lang.String lookupName)
          Constructor taking a lookupName for an InitialContext to create a connection to a database
 
Method Summary
 java.lang.Object clone()
          clone the connector object, not copying the connection itself.
 void close()
          close this connector and the contained connection
 java.sql.Connection getConnection()
          get the JDBC connection for this Connector
 java.lang.String getUser()
          get the user which is connected to the database
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteConnector

public RemoteConnector(java.lang.String lookupName)
Constructor taking a lookupName for an InitialContext to create a connection to a database

Parameters:
lookupName - String, the lookup for the connection to use
Method Detail

close

public void close()
           throws java.sql.SQLException
close this connector and the contained connection

Specified by:
close in interface Connector
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
get the JDBC connection for this Connector

Specified by:
getConnection in interface Connector
Returns:
Connection
Throws:
java.sql.SQLException

getUser

public java.lang.String getUser()
get the user which is connected to the database

Specified by:
getUser in interface Connector
Returns:
the name of the user connected

clone

public java.lang.Object clone()
clone the connector object, not copying the connection itself. Used of the clone connector will thus make a new connection to the database

Specified by:
clone in interface Connector
Overrides:
clone in class java.lang.Object
Returns: