|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xenonsoft.bridgetown.aop.transaction.jdbc.PropertyJDBCDataSourceImpl
An implementation of a data source that makes a traditional JDBC connection to a database using a input list of properties or through set bean properties.
| Field Summary | |
static java.lang.String |
DRIVER_CLASS_PROPERTY
|
protected java.lang.String |
driverClass
Driver class |
static java.lang.String |
JDBC_URL_PROPERTY
|
protected java.lang.String |
jdbcUrl
Jdbc Url for database connection |
protected int |
loginTimeout
Login time out |
protected java.io.PrintWriter |
logWriter
log writer for this data source connection |
protected ConnectionModeEnum |
mode
Connection mode |
protected java.lang.String |
password
Security credential |
static java.lang.String |
PASSWORD_PROPERTY
|
protected java.lang.String |
username
Security principal |
static java.lang.String |
USERNAME_PROPERTY
|
| Constructor Summary | |
PropertyJDBCDataSourceImpl()
Default constructor is useful if you need construct the bean then use setter injection |
|
PropertyJDBCDataSourceImpl(java.util.Properties properties)
Standard constructor |
|
PropertyJDBCDataSourceImpl(java.lang.String prefix,
java.util.Properties properties)
Standard constructor |
|
PropertyJDBCDataSourceImpl(java.lang.String driverClass,
java.lang.String jdbcUrl)
A standard constructor to suppert constructor injection |
|
PropertyJDBCDataSourceImpl(java.lang.String driverClass,
java.lang.String jdbcUrl,
java.lang.String username,
java.lang.String password)
A standard constructor to suppert constructor injection |
|
| Method Summary | |
java.sql.Connection |
getConnection()
Implements / overrides getConnection |
java.sql.Connection |
getConnection(java.lang.String requestUser,
java.lang.String requestPass)
Implements / overrides getConnection |
java.lang.String |
getDriverClass()
Gets the driverClass |
java.lang.String |
getJdbcUrl()
Gets the jdbcUrl |
int |
getLoginTimeout()
Implements / overrides getLoginTimeout |
java.io.PrintWriter |
getLogWriter()
Implements / overrides getLogWriter |
ConnectionModeEnum |
getMode()
Gets the connection mode |
java.lang.String |
getPassword()
Gets the password (the database security credential) |
java.lang.String |
getUsername()
Gets the username (the database security principal) |
void |
readDetailFromProperties(java.lang.String prefix,
java.util.Properties properties)
Read the JDBC configuration detail from the supplied properties |
void |
setDriverClass(java.lang.String driverClass)
Sets the driverClass |
void |
setJdbcUrl(java.lang.String jdbcUrl)
Sets the jdbcUrl |
void |
setLoginTimeout(int arg0)
Implements / overrides setLoginTimeout |
void |
setLogWriter(java.io.PrintWriter arg0)
Implements / overrides setLogWriter |
void |
setMode(ConnectionModeEnum mode)
Sets the connection mode |
void |
setMode(java.lang.String modeValue)
Sets the connection mode from a text string |
void |
setPassword(java.lang.String password)
Sets the password (the database security credential) |
void |
setUsername(java.lang.String username)
Sets the username (the database security principal) |
java.lang.String |
toString()
Debuggable human output |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String DRIVER_CLASS_PROPERTY
public static final java.lang.String JDBC_URL_PROPERTY
public static final java.lang.String USERNAME_PROPERTY
public static final java.lang.String PASSWORD_PROPERTY
protected java.lang.String driverClass
protected java.lang.String jdbcUrl
protected java.lang.String username
protected java.lang.String password
protected int loginTimeout
protected java.io.PrintWriter logWriter
protected ConnectionModeEnum mode
| Constructor Detail |
public PropertyJDBCDataSourceImpl()
public PropertyJDBCDataSourceImpl(java.lang.String driverClass,
java.lang.String jdbcUrl)
driverClass - the JDBC driverjdbcUrl - the JDBC URL for connection
public PropertyJDBCDataSourceImpl(java.lang.String driverClass,
java.lang.String jdbcUrl,
java.lang.String username,
java.lang.String password)
driverClass - the JDBC driverjdbcUrl - the JDBC URL for connectionusername - the security principalpassword - the security credentialpublic PropertyJDBCDataSourceImpl(java.util.Properties properties)
properties - the Java properties to retrieve JDBC login
public PropertyJDBCDataSourceImpl(java.lang.String prefix,
java.util.Properties properties)
prefix - the prefix for the property name during
retrieval of JDBC configurationproperties - the Java properties to retrieve JDBC login| Method Detail |
public java.lang.String getDriverClass()
public void setDriverClass(java.lang.String driverClass)
driverClass - the new value for driverClasspublic java.lang.String getJdbcUrl()
public void setJdbcUrl(java.lang.String jdbcUrl)
jdbcUrl - the new value for jdbcUrlpublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - the new value for passwordpublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username - the new value for username
public void readDetailFromProperties(java.lang.String prefix,
java.util.Properties properties)
prefix - the prefix for the property name during
retrieval of JDBC configurationproperties - the Java properties
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionDataSource.getConnection()
public java.sql.Connection getConnection(java.lang.String requestUser,
java.lang.String requestPass)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcerequestUser - the requested username (sic security principal)requestPass - the requested password (sic security credential)
java.sql.SQLExceptionDataSource.getConnection(java.lang.String, java.lang.String)
public int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.DataSourcejava.sql.SQLExceptionDataSource.getLoginTimeout()
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.DataSourcejava.sql.SQLExceptionDataSource.getLogWriter()
public void setLoginTimeout(int arg0)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.DataSourcearg0 -
java.sql.SQLExceptionDataSource.setLoginTimeout(int)
public void setLogWriter(java.io.PrintWriter arg0)
throws java.sql.SQLException
setLogWriter in interface javax.sql.DataSourcearg0 -
java.sql.SQLExceptionDataSource.setLogWriter(java.io.PrintWriter)public ConnectionModeEnum getMode()
public void setMode(ConnectionModeEnum mode)
mode - the new value for modepublic void setMode(java.lang.String modeValue)
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||