org.gcube.data.spd.ncbi.connection
Class ConnectionPool

java.lang.Object
  extended by org.gcube.data.spd.ncbi.connection.ConnectionPool

public class ConnectionPool
extends Object


Field Summary
static String dbUrl
           
 
Method Summary
 boolean copy(String query, String file)
          Copy csv to table
 Connection getConnection()
          get a free connection or create a new one
static ConnectionPool getConnectionPool()
          get connection pool
static boolean insertPreStatement(String query)
          Insert
 boolean preStatement(String query, ArrayList<String> terms, PreparedStatement stmt)
          Update
 void releaseConnection(Connection con)
          Release the connection and put it in the queue
 ResultSet selectPrestatement(String query, ArrayList<String> terms, PreparedStatement stmt)
          Select using preStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbUrl

public static String dbUrl
Method Detail

getConnectionPool

public static ConnectionPool getConnectionPool()
                                        throws ConnectionPoolException
get connection pool

Throws:
ConnectionPoolException

getConnection

public Connection getConnection()
                         throws ConnectionPoolException
get a free connection or create a new one

Throws:
ConnectionPoolException

releaseConnection

public void releaseConnection(Connection con)
Release the connection and put it in the queue


preStatement

public boolean preStatement(String query,
                            ArrayList<String> terms,
                            PreparedStatement stmt)
Update

Parameters:
stmt2 -

selectPrestatement

public ResultSet selectPrestatement(String query,
                                    ArrayList<String> terms,
                                    PreparedStatement stmt)
Select using preStatement


insertPreStatement

public static boolean insertPreStatement(String query)
Insert


copy

public boolean copy(String query,
                    String file)
Copy csv to table



Copyright © 2013. All Rights Reserved.