|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ddlutils.util.JdbcSupport
public abstract class JdbcSupport
JdbcSupport is an abstract base class for objects which need to perform JDBC operations. It contains a number of useful methods for implementation inheritence..
Constructor Summary | |
---|---|
JdbcSupport()
|
Method Summary | |
---|---|
java.sql.Connection |
borrowConnection()
Returns a (new) JDBC connection from the data source. |
void |
closeStatement(java.sql.Statement statement)
Closes the given statement (which also closes all result sets for this statement) and the connection it belongs to. |
javax.sql.DataSource |
getDataSource()
Returns the data source used for communicating with the database. |
java.lang.String |
getPassword()
Returns the password used to access the database. |
java.lang.String |
getUsername()
Returns the username used to access the database. |
void |
returnConnection(java.sql.Connection connection)
Closes the given JDBC connection (returns it back to the pool if the datasource is poolable). |
void |
setDataSource(javax.sql.DataSource dataSource)
Sets the DataSource used for communicating with the database. |
void |
setPassword(java.lang.String password)
Sets the password to be used to access the database. |
void |
setUsername(java.lang.String username)
Sets the username to be used to access the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdbcSupport()
Method Detail |
---|
public javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.DataSource dataSource)
dataSource
- The data sourcepublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- The usernamepublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The passwordpublic java.sql.Connection borrowConnection() throws DatabaseOperationException
DatabaseOperationException
public void returnConnection(java.sql.Connection connection)
connection
- The connectionpublic void closeStatement(java.sql.Statement statement)
statement
- The statement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |