public class DbManager extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
THREAD_LOCK |
| 限定符和类型 | 方法和说明 |
|---|---|
Connection |
beginTransaction()
When working within a transaction, you should invoke this method first.
|
void |
close(ResultSet rs)
Close the passed ResultSet.
|
void |
close(Statement s)
Close the passed Statement.
|
void |
close(Statement s,
ResultSet rs)
Close the passed Statement and ResultSet.
|
void |
endTransaction(boolean commit)
Release connection used for the transaction and perform a commit or rollback.
|
Connection |
getConnection()
Get an auto commit connection.
|
static DbManager |
getInstance(String configKey) |
void |
log(String message)
Log a message using the underlying logwriter, if not null.
|
void |
releaseConnection(Connection c)
Release the connection.
|
public Connection getConnection() throws SQLException
SQLExceptionpublic void releaseConnection(Connection c)
public Connection beginTransaction() throws SQLException
SQLExceptionpublic void endTransaction(boolean commit)
throws SQLException
commit - tells whether this connection should be committed: true for commit(), false for rollback()SQLExceptionpublic void log(String message)
public void close(Statement s)
public void close(ResultSet rs)
Copyright © 2023 onecode. All rights reserved.