sqlwrapper
Class SqLiteSQLWrapper

java.lang.Object
  extended by sqlwrapper.SqLiteSQLWrapper
All Implemented Interfaces:
SQLWrapper

public class SqLiteSQLWrapper
extends java.lang.Object
implements SQLWrapper

Implementation of the SQLWrapper interface for SQLite embedded database.


Field Summary
private  java.sql.Connection conn
           
private  java.lang.String dbName
           
private  java.lang.String dbPath
           
private  java.lang.String driver
           
private  java.lang.String protocol
           
private static SqLiteSQLWrapper sqLiteInstance
          Single instance created upon class loading.
 
Constructor Summary
private SqLiteSQLWrapper()
           
 
Method Summary
 void commit()
          Commit transaction
 boolean execute(java.lang.String sql)
          Execute SQL statement for data definition and manipulation
 QueryResult executeQuery(java.lang.String sql)
          Execute SQL statement for data query
 boolean flush()
          Commit transaction, delete temporary data
private  java.sql.Connection getConnection()
           
static SqLiteSQLWrapper getInstance()
          Returns the singleton sqLite instance
private  void loadDriver()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

driver

private final java.lang.String driver
See Also:
Constant Field Values

protocol

private final java.lang.String protocol
See Also:
Constant Field Values

dbName

private final java.lang.String dbName
See Also:
Constant Field Values

dbPath

private java.lang.String dbPath

conn

private java.sql.Connection conn

sqLiteInstance

private static final SqLiteSQLWrapper sqLiteInstance
Single instance created upon class loading.

Constructor Detail

SqLiteSQLWrapper

private SqLiteSQLWrapper()
Method Detail

getInstance

public static SqLiteSQLWrapper getInstance()
Returns the singleton sqLite instance

Returns:
sqLiteInstance

execute

public boolean execute(java.lang.String sql)
Execute SQL statement for data definition and manipulation

Specified by:
execute in interface SQLWrapper
Parameters:
sql - Sql operation
Returns:
success of executed operation

executeQuery

public QueryResult executeQuery(java.lang.String sql)
Execute SQL statement for data query

Specified by:
executeQuery in interface SQLWrapper
Parameters:
sql - Sql operation
Returns:
queryResult

commit

public void commit()
Commit transaction

Specified by:
commit in interface SQLWrapper

flush

public boolean flush()
Commit transaction, delete temporary data

Specified by:
flush in interface SQLWrapper
Returns:
success of the operation

getConnection

private java.sql.Connection getConnection()
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

loadDriver

private void loadDriver()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException