public class LocalConnector extends java.lang.Object implements Connector
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_classPath |
protected java.sql.Driver |
m_driver |
protected java.util.Properties |
m_info |
protected java.lang.String |
m_url |
| Modifier | Constructor and Description |
|---|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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 |
getURL()
get the user which is connected to the database
|
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.
|
protected java.lang.String m_url
protected java.sql.Driver m_driver
protected java.util.Properties m_info
protected java.lang.String m_classPath
protected LocalConnector()
Only used for overwriting this class as needed. Initialize the values yourself
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 - String, 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 - String, 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.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface Connectorjava.sql.SQLExceptionpublic void close()
throws 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 - String, 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()
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()