Package io.odysz.semantic.DA.drvmnger
Class SqliteDriver2
- Direct Known Subclasses:
SqliteDriverQueued
All instance using the same connection.
Sqlite connection.
SqliteDriver using sigle connection to avoid error:
see StackOverflow: Getting [SQLITE_BUSY] database file is locked with select statements
Sqlite connection.
SqliteDriver using sigle connection to avoid error:
see StackOverflow: Getting [SQLITE_BUSY] database file is locked with select statements
- Author:
- odys-z@github.com
-
Field Summary
Modifier and TypeFieldDescriptionprotected Connection
Sqlite connection.
SqliteDriver using sigle connection to avoid error:
org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
see StackOverflow: Getting [SQLITE_BUSY] database file is locked with select statementsFields inherited from class io.odysz.semantic.DA.AbsConnect
drvName, enableSystemout, flag_disableSql, flag_nothing, flag_printSql, id, locks, log
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
close()
int[]
int[]
Commit statementMUST CLOSE CONNECTION!static SqliteDriver2
initConnection
(String id, String jdbc, String user, String psword, boolean log, int flags) GetSqliteDriver2
instance, with database connection got viaDriverManager
.Methods inherited from class io.odysz.semantic.DA.AbsConnect
commit, driverType, getAutoseqLock, initDmConnect, initPooledConnect, printSql, printSql, prop, prop
-
Field Details
-
conn
Sqlite connection.
SqliteDriver using sigle connection to avoid error:
org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
see StackOverflow: Getting [SQLITE_BUSY] database file is locked with select statements
-
-
Method Details
-
close
- Overrides:
close
in classAbsConnect<SqliteDriver2>
- Throws:
SQLException
-
getConnection
MUST CLOSE CONNECTION!- Returns:
- connection
- Throws:
SQLException
-
initConnection
public static SqliteDriver2 initConnection(String id, String jdbc, String user, String psword, boolean log, int flags) throws SQLException GetSqliteDriver2
instance, with database connection got viaDriverManager
.- Parameters:
jdbc
-user
-psword
-log
-flags
-- Returns:
- SqliteDriver2 instance
- Throws:
SQLException
-
select
- Specified by:
select
in classAbsConnect<SqliteDriver2>
- Throws:
SQLException
-
commit
Commit statement- Specified by:
commit
in classAbsConnect<SqliteDriver2>
- Parameters:
sqls
-flags
-- Returns:
- The update counts in order of commands
- Throws:
SQLException
-
commit
public int[] commit(io.odysz.semantics.IUser usr, ArrayList<String> sqls, ArrayList<Clob> lobs, int i) throws SQLException - Specified by:
commit
in classAbsConnect<SqliteDriver2>
- Throws:
SQLException
-