public class ThreadSafeDatabase extends Database
Constructor and Description |
---|
ThreadSafeDatabase(Database db)
Deprecated.
Wraps the given database with a threadsafe version
|
Modifier and Type | Method and Description |
---|---|
void |
beginTransaction()
Deprecated.
Starts a transaction
|
void |
close()
Deprecated.
Closes the database
|
void |
commitTransaction()
Deprecated.
Commits current transaction
|
void |
execute(String sql)
Deprecated.
Execute an update query.
|
void |
execute(String sql,
Object... params)
Deprecated.
Execute an update query with params.
|
void |
execute(String sql,
String[] params)
Deprecated.
Execute an update query with params.
|
Cursor |
executeQuery(String sql)
Deprecated.
This method should be called with SELECT type statements that return
row set.
|
Cursor |
executeQuery(String sql,
Object... params)
Deprecated.
This method should be called with SELECT type statements that return
row set it accepts object with params.
|
Cursor |
executeQuery(String sql,
String[] params)
Deprecated.
This method should be called with SELECT type statements that return
row set.
|
EasyThread |
getThread()
Deprecated.
Returns the underlying easy thread we can use to pipe tasks to the db thread
|
void |
rollbackTransaction()
Deprecated.
Rolls back current transaction
|
delete, exists, getDatabasePath, isCustomPathSupported, openOrCreate, supportsWasNull, wasNull
public ThreadSafeDatabase(Database db)
db
- the databasepublic EasyThread getThread()
public void beginTransaction() throws IOException
Database
NOTE: Not supported in Javascript port. This method will do nothing when running in Javascript.
beginTransaction
in class Database
IOException
- if database is not openedpublic void commitTransaction() throws IOException
Database
NOTE: Not supported in Javascript port. This method will do nothing when running in Javascript.
commitTransaction
in class Database
IOException
- if database is not opened or transaction was not startedpublic void rollbackTransaction() throws IOException
Database
NOTE: Not supported in Javascript port. This method will do nothing when running in Javascript.
rollbackTransaction
in class Database
IOException
- if database is not opened or transaction was not startedpublic void close()
Database
public void execute(String sql) throws IOException
Database
execute
in class Database
sql
- the sql to executeIOException
public void execute(String sql, String[] params) throws IOException
Database
execute
in class Database
sql
- the sql to executeparams
- to bind to the query where the '?' existsIOException
public Cursor executeQuery(String sql, String[] params) throws IOException
Database
executeQuery
in class Database
sql
- the sql to executeparams
- to bind to the query where the '?' existsIOException
public Cursor executeQuery(String sql) throws IOException
Database
executeQuery
in class Database
sql
- the sql to executeIOException
public Cursor executeQuery(String sql, Object... params) throws IOException
Database
executeQuery
in class Database
sql
- the sql to executeparams
- to bind to the query where the '?' exists, supported object
types are String, byte[], Double, Long and nullIOException
public void execute(String sql, Object... params) throws IOException
Database
execute
in class Database
sql
- the sql to executeparams
- to bind to the query where the '?' exists, supported object
types are String, byte[], Double, Long and nullIOException