|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.allegato.JDBCConfig
public class JDBCConfig
Encapsulates the configuration of a JDBC connection. The class provides access to all JDBC parameters specified in a XML element or set using the set methods.
The class also provides a method to establish the connection.
Constructor Summary | |
---|---|
JDBCConfig()
Default constructor |
|
JDBCConfig(java.lang.String name,
XMLProperties xmlProps)
Initialises this config object with the given XML configuration |
Method Summary | |
---|---|
java.sql.Connection |
createConnection()
Creates a connection using the configuration properties of this configuration object and returns the connection. |
java.lang.String |
getConnectionString()
Returns the connection string for this config object. |
java.lang.String |
getDriver()
Returns the driver string for this config object. |
java.lang.String |
getPassword()
Returns the password for this config object. |
java.lang.String |
getUserName()
Returns the user name for this config object. |
void |
setConnectionString(java.lang.String connStr)
Set the connection string for this config object. |
void |
setDriver(java.lang.String driver)
Set the driver string for this config object. |
void |
setPassword(java.lang.String password)
Set the password for this config object. |
void |
setUserName(java.lang.String userName)
Set the user name for this config object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCConfig()
public JDBCConfig(java.lang.String name, XMLProperties xmlProps) throws ConfException
name
- The name of the JDBC configurationxmlProps
- XML configuration properties containing a valid
JDBCConfig element.
ConfException
- if this object cannot be initialised.Method Detail |
---|
public void setDriver(java.lang.String driver)
driver
- Driver class name.public java.lang.String getDriver()
public void setUserName(java.lang.String userName)
userName
- User name used to establish database connection.public java.lang.String getUserName()
public void setPassword(java.lang.String password)
password
- Password used by this object to establish a database
connection.public java.lang.String getPassword()
public void setConnectionString(java.lang.String connStr)
connStr
- Connection string used to establish a database connection.
This is a driver specific string.public java.lang.String getConnectionString()
public java.sql.Connection createConnection() throws java.sql.SQLException
java.sql.SQLException
- if a database connection cannot be established.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |