public abstract class JdbcSupport extends Object
| Constructor and Description |
|---|
JdbcSupport() |
| Modifier and Type | Method and Description |
|---|---|
Connection |
borrowConnection()
Returns a (new) JDBC connection from the data source.
|
void |
closeStatement(Statement statement)
Closes the given statement (which also closes all result sets for this statement) and the
connection it belongs to.
|
DataSource |
getDataSource()
Returns the data source used for communicating with the database.
|
int |
getIsolationLevel() |
String |
getPassword()
Returns the password used to access the database.
|
String |
getUsername()
Returns the username used to access the database.
|
void |
returnConnection(Connection connection)
Closes the given JDBC connection (returns it back to the pool if the datasource is poolable).
|
void |
setDataSource(DataSource dataSource)
Sets the DataSource used for communicating with the database.
|
void |
setIsolationLevel(int level) |
void |
setPassword(String password)
Sets the password to be used to access the database.
|
void |
setUsername(String username)
Sets the username to be used to access the database.
|
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
dataSource - The data sourcepublic String getUsername()
public void setUsername(String username)
username - The usernamepublic String getPassword()
public void setPassword(String password)
password - The passwordpublic Connection borrowConnection() throws DatabaseOperationException
DatabaseOperationExceptionpublic void returnConnection(Connection connection)
connection - The connectionpublic void closeStatement(Statement statement)
statement - The statementpublic int getIsolationLevel()
public void setIsolationLevel(int level)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.