public class DbManager extends Object implements AutoCloseable
| Constructor and Description |
|---|
DbManager() |
DbManager(Connection conn) |
DbManager(DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotClosed() |
void |
beginTransaction() |
void |
close() |
void |
commit() |
int |
delete(Record key,
Table table) |
protected int |
delete(Record key,
Table table,
boolean addBatch) |
void |
deleteBatch(Record key,
Table table) |
void |
executeBatch() |
boolean |
exists(Record key,
Table table) |
List<Record> |
getAll(Table table) |
Connection |
getConnection() |
static DataSource |
getDataSource() |
Record |
getRecord(Record key,
Table table) |
protected com.appslandia.common.easyrecord.DbManager.StatCache |
getStatCache(String tableName) |
long |
insert(Record record,
Table table) |
protected long |
insert(Record record,
Table table,
boolean addBatch) |
void |
insertBatch(Record record,
Table table) |
void |
rollback() |
static void |
setDataSource(DataSource dataSource) |
protected void |
setParameter(StatementImpl stat,
String parameterName,
Object val,
int sqlType) |
protected Object |
toSqlObject(Object val,
int sqlType) |
int |
update(Record record,
Table table) |
protected int |
update(Record record,
Table table,
boolean addBatch) |
void |
updateBatch(Record record,
Table table) |
public DbManager()
throws SQLException
SQLExceptionpublic DbManager(Connection conn)
public DbManager(DataSource dataSource) throws SQLException
SQLExceptionpublic Connection getConnection()
public long insert(Record record, Table table) throws SQLException
SQLExceptionpublic void insertBatch(Record record, Table table) throws SQLException
SQLExceptionprotected void setParameter(StatementImpl stat, String parameterName, Object val, int sqlType) throws SQLException
SQLExceptionprotected com.appslandia.common.easyrecord.DbManager.StatCache getStatCache(String tableName)
protected long insert(Record record, Table table, boolean addBatch) throws SQLException
SQLExceptionpublic int update(Record record, Table table) throws SQLException
SQLExceptionpublic void updateBatch(Record record, Table table) throws SQLException
SQLExceptionprotected int update(Record record, Table table, boolean addBatch) throws SQLException
SQLExceptionpublic int delete(Record key, Table table) throws SQLException
SQLExceptionpublic void deleteBatch(Record key, Table table) throws SQLException
SQLExceptionprotected int delete(Record key, Table table, boolean addBatch) throws SQLException
SQLExceptionpublic Record getRecord(Record key, Table table) throws SQLException
SQLExceptionpublic boolean exists(Record key, Table table) throws SQLException
SQLExceptionpublic List<Record> getAll(Table table) throws SQLException
SQLExceptionpublic void executeBatch()
throws SQLException
SQLExceptionpublic void beginTransaction()
throws SQLException
SQLExceptionpublic void commit()
throws SQLException
SQLExceptionpublic void rollback()
throws SQLException
SQLExceptionprotected void assertNotClosed()
throws SQLException
SQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableSQLExceptionpublic static DataSource getDataSource()
public static void setDataSource(DataSource dataSource)
Copyright © 2017. All rights reserved.