com.splout.db.common
Class SQLiteJDBCManager

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

public class SQLiteJDBCManager
extends java.lang.Object
implements ISQLiteManager

SQL Wrapper for querying SQLite through a connection pool using BoneCP (http://jolbox.com/).


Constructor Summary
SQLiteJDBCManager(java.lang.String dbFile, int nConnections)
           
 
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)
          The contract of this function is to return a JSON-ized ArrayList of JSON Objects which in Java are represented as Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLiteJDBCManager

public SQLiteJDBCManager(java.lang.String dbFile,
                         int nConnections)
                  throws java.sql.SQLException,
                         java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
Method Detail

getConnectionFromPool

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

query

public java.lang.String query(java.lang.String query,
                              int maxResults)
                       throws java.sql.SQLException,
                              JSONSerDe.JSONSerDeException
The contract of this function is to return a JSON-ized ArrayList of JSON Objects which in Java are represented as Map. So, for a query with no results, an empty ArrayList is returned.

Specified by:
query in interface ISQLiteManager
Throws:
java.sql.SQLException
JSONSerDe.JSONSerDeException

close

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

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


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