| Constructor and Description |
|---|
SrvDatabase() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTransaction()
Start new transaction.
|
void |
commitTransaction()
Commit transaction.
|
void |
createSavepoint(String pSavepointName)
Create savepoint.
|
int |
executeDelete(String pTable,
String pWhere)
Execute SQL DELETE that returns affected rows.
|
long |
executeInsert(String pTable,
org.beigesoft.orm.model.ColumnsValues pColumnsVals)
Execute SQL INSERT that returns affected rows.
|
void |
executeQuery(String pQuery)
Execute any SQL query that returns no data.
|
int |
executeUpdate(String pTable,
org.beigesoft.orm.model.ColumnsValues pColumnsVals,
String pWhere)
Execute SQL UPDATE that returns affected rows.
|
Connection |
getCurrentConnection()
Getter for current connection per thread.
|
DataSource |
getDataSource()
Geter for dataSource.
|
org.beigesoft.orm.service.HlpInsertUpdate |
getHlpInsertUpdate()
Geter for hlpInsertUpdate.
|
boolean |
getIsAutocommit()
Get if an transaction is started.
|
Connection |
getOrEstablishConnection()
Getor establish connection per thread.
|
Map<String,Savepoint> |
getSavepointsMap()
Geter for savepointsMap.
|
ThreadLocal<Connection> |
getThreadConnection()
Geter for threadConnection.
|
int |
getTransactionIsolation()
Get transaction isolation level.
|
void |
releaseResources()
Release resources if they is not null.
|
void |
releaseSavepoint(String pSavepointName)
Release savepoint.
|
org.beigesoft.orm.model.IRecordSet<ResultSet> |
retrieveRecords(String pSelect)
Retrieve records from DB.
|
void |
rollBackTransaction()
Rollback transaction.
|
void |
rollBackTransaction(String pSavepointName)
Rollback transaction to savepoint.
|
void |
setDataSource(DataSource pDataSource)
Setter for dataSource.
|
void |
setHlpInsertUpdate(org.beigesoft.orm.service.HlpInsertUpdate pHlpInsertUpdate)
Setter for hlpInsertUpdate.
|
void |
setIsAutocommit(boolean pIsAutocommit)
Set RDBMS autocommit mode.
|
void |
setTransactionIsolation(int pLevel)
Set transaction isolation level.
|
public final boolean getIsAutocommit()
throws Exception
Get if an transaction is started.
pIsAutocommit - is autocommitException - - an exceptionpublic final void setIsAutocommit(boolean pIsAutocommit)
throws Exception
Set RDBMS autocommit mode.
pIsAutocommit - if autocommitException - - an exceptionpublic final void setTransactionIsolation(int pLevel)
throws Exception
Set transaction isolation level.
pLevel - according ASrvDatabaseException - - an exceptionpublic final int getTransactionIsolation()
throws Exception
Get transaction isolation level.
You must setTransactionIsolation
before invoke it cause a RDBMS may has any level by default.
Exception - - an exceptionpublic final void createSavepoint(String pSavepointName) throws Exception
Create savepoint.
pSavepointName - savepoint nameException - - an exceptionpublic final void releaseSavepoint(String pSavepointName) throws Exception
Release savepoint.
pSavepointName - savepoint nameException - - an exceptionpublic final void rollBackTransaction(String pSavepointName) throws Exception
Rollback transaction to savepoint.
pSavepointName - savepoint nameException - - an exceptionpublic final void beginTransaction()
throws Exception
Start new transaction.
Exception - - an exceptionpublic final void commitTransaction()
throws Exception
Commit transaction.
Exception - - an exceptionpublic final void rollBackTransaction()
throws Exception
Rollback transaction.
Exception - - an exceptionpublic final void releaseResources()
throws Exception
Release resources if they is not null.
Exception - - an exceptionpublic final org.beigesoft.orm.model.IRecordSet<ResultSet> retrieveRecords(String pSelect) throws Exception
Retrieve records from DB.
pSelect - query SELECTException - - an exceptionpublic final void executeQuery(String pQuery) throws Exception
Execute any SQL query that returns no data. E.g. PRAGMA, etc.
pQuery - queryException - - an exceptionpublic final int executeUpdate(String pTable, org.beigesoft.orm.model.ColumnsValues pColumnsVals, String pWhere) throws Exception
Execute SQL UPDATE that returns affected rows. It is to adapt Android insert/update/delete interface.
pTable - table namepColumnsVals - type-safe map column name - column valuepWhere - where conditions e.g. "itsId=2"Exception - - an exceptionpublic final long executeInsert(String pTable, org.beigesoft.orm.model.ColumnsValues pColumnsVals) throws Exception
Execute SQL INSERT that returns affected rows. It is to adapt Android insert/update/delete interface.
pTable - table namepColumnsVals - type-safe map column name - column valueException - - an exceptionpublic final int executeDelete(String pTable, String pWhere) throws Exception
Execute SQL DELETE that returns affected rows. It is to adapt Android insert/update/delete interface.
pTable - table namepWhere - where conditions e.g. "itsId=2" or NULL -delete allException - - an exceptionpublic final Connection getOrEstablishConnection() throws Exception
Getor establish connection per thread.
Exception - - an exceptionpublic final Connection getCurrentConnection() throws Exception
Getter for current connection per thread.
Exception - - an exceptionpublic final ThreadLocal<Connection> getThreadConnection()
Geter for threadConnection.
public final DataSource getDataSource()
Geter for dataSource.
public final void setDataSource(DataSource pDataSource)
Setter for dataSource.
pDataSource - referencepublic final org.beigesoft.orm.service.HlpInsertUpdate getHlpInsertUpdate()
Geter for hlpInsertUpdate.
public final void setHlpInsertUpdate(org.beigesoft.orm.service.HlpInsertUpdate pHlpInsertUpdate)
Setter for hlpInsertUpdate.
pHlpInsertUpdate - referenceCopyright © 2016 Beigesoft ™. All rights reserved.