|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.sql.LocalConnector
public class LocalConnector
Implementation of Connector to connect to a local JDBC source, defined by the parameters passed in the constructor
Field Summary | |
---|---|
protected java.sql.Driver |
m_driver
|
protected java.util.Properties |
m_info
|
protected java.lang.String |
m_url
|
Constructor Summary | |
---|---|
protected |
LocalConnector()
Constructor which does not initialize the connection properties. |
|
LocalConnector(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Constructor |
|
LocalConnector(java.lang.String classpath,
java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Constructor |
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 |
getDbName()
get the database name this connection uses. |
java.lang.String |
getServerName()
get the name of the server this connection uses. |
java.lang.String |
getUser()
Returns the name of the user this connection is using |
protected void |
init(java.lang.String classPath,
java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Initializes the parameters needed to make a connection. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String m_url
protected java.sql.Driver m_driver
protected java.util.Properties m_info
Constructor Detail |
---|
protected LocalConnector()
Only used for overwriting this class as needed. Initialize the values yourself
init(String, String, String, String, String)
public LocalConnector(java.lang.String driver, java.lang.String url, java.lang.String user, java.lang.String password)
Requirement of the user and password parameters depends on the driver used. Set to null if not used.
driver
- String, the classname of the driver to use.
The class should be in the classpathurl,
- the JDBC url describing which driver,server, port and database
to use. See JDBC api description for syntaxuser,
- String the username to use for this connectionpassword,
- String the password to use for this connectionpublic LocalConnector(java.lang.String classpath, java.lang.String driver, java.lang.String url, java.lang.String user, java.lang.String password)
Requirement of the user and password parameters depends on the driver used. Set to null if not used.
classpath
- String, a semi-colon seperated list of jars and/or
dirs containing the driverdriver
- String, the classname of the driver to use.
The class should be in the supplied classpath or the default classpathurl,
- the JDBC url describing which driver,server, port and database
to use. See JDBC api description for syntaxuser,
- String the username to use for this connectionpassword,
- String the password to use for this connectionMethod Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface Connector
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface Connector
java.sql.SQLException
protected void init(java.lang.String classPath, java.lang.String driver, java.lang.String url, java.lang.String user, java.lang.String password)
Requirement of the user and password parameters depends on the driver used.
classpath
- String, a semi-colon seperated list of jars and/or
dirs containing the driverdriver
- String, the classname of the driver to use.
The class should be in the classpathurl,
- the JDBC url describing which driver,server, port and database
to use. See JDBC api description for syntaxuser,
- String the username to use for this connectionpassword,
- String the password to use for this connectionpublic java.lang.String getUser()
getUser
in interface Connector
public java.lang.String getDbName()
Information is destilled from the url provided.
public java.lang.String getServerName()
Information is destilled from the url provided.
public java.lang.Object clone()
clone
in interface Connector
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |