com.splout.db.common
Class SQLite4JavaManager

java.lang.Object
  extended by com.splout.db.common.SQLite4JavaManager
All Implemented Interfaces:
ISQLiteManager

public class SQLite4JavaManager
extends java.lang.Object
implements ISQLiteManager

SQL Wrapper for querying SQLite by using sqlite4java (http://code.google.com/p/sqlite4java).


Constructor Summary
SQLite4JavaManager(java.lang.String dbFile, java.util.List<java.lang.String> initStatements)
           
 
Method Summary
 void close()
           
 java.lang.String exec(java.lang.String query)
           
 java.sql.Connection getConnectionFromPool()
           
 java.lang.String query(java.lang.String query, int maxResults)
           
 void setTimeoutThread(TimeoutThread timeoutThread)
          Optionally sets a TimeoutThread that will take care of cancelling long-running queries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLite4JavaManager

public SQLite4JavaManager(java.lang.String dbFile,
                          java.util.List<java.lang.String> initStatements)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

setTimeoutThread

public void setTimeoutThread(TimeoutThread timeoutThread)
Optionally sets a TimeoutThread that will take care of cancelling long-running queries. If present, each SQLiteConnectiona associated with each thread will be monitored by this thread to see if there is some query that needs to be interrupted.


exec

public java.lang.String exec(java.lang.String query)
                      throws java.sql.SQLException,
                             JSONSerDe.JSONSerDeException
Specified by:
exec in interface ISQLiteManager
Throws:
java.sql.SQLException
JSONSerDe.JSONSerDeException

query

public java.lang.String query(java.lang.String query,
                              int maxResults)
                       throws java.sql.SQLException,
                              JSONSerDe.JSONSerDeException
Specified by:
query in interface ISQLiteManager
Throws:
java.sql.SQLException
JSONSerDe.JSONSerDeException

close

public void close()
Specified by:
close in interface ISQLiteManager

getConnectionFromPool

public java.sql.Connection getConnectionFromPool()
                                          throws java.sql.SQLException
Specified by:
getConnectionFromPool in interface ISQLiteManager
Throws:
java.sql.SQLException


Copyright © 2012-2013 Datasalt Systems S.L.. All Rights Reserved.