public class SQLiteDB
extends java.lang.Object
SQLiteDB implements interface to the database. | Modifier and Type | Field and Description |
|---|---|
(package private) com.almworks.sqlite4java.SQLiteConnection |
con
Connection to the database.
|
private static org.apache.log4j.Logger |
log
Used to log different events.
|
(package private) com.almworks.sqlite4java.SQLiteStatement |
st
Statement to be executed.
|
| Constructor and Description |
|---|
SQLiteDB(java.lang.String databasePath)
Constructs the object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes connection to the database.
|
java.util.ArrayList<java.lang.Object[]> |
executeQuery(java.lang.String str)
Executes a SQL command and returns a result.
|
boolean |
executeUpdate(java.lang.String str)
Executes a SQL command without returning any result.
|
private static org.apache.log4j.Logger log
com.almworks.sqlite4java.SQLiteConnection con
com.almworks.sqlite4java.SQLiteStatement st
public SQLiteDB(java.lang.String databasePath)
throws java.lang.Exception
databasePath - path to the database filejava.lang.Exception - when cannot open the database filepublic boolean executeUpdate(java.lang.String str)
str - SQL command to be executedtrue if the SQL command was successfully executed, false otherwisepublic java.util.ArrayList<java.lang.Object[]> executeQuery(java.lang.String str)
str - SQL command to be executedpublic void close()