com.fuse.storage.sql
Class DatabaseConnectionManager

java.lang.Object
  extended by com.fuse.storage.sql.DatabaseConnectionManager

public class DatabaseConnectionManager
extends java.lang.Object

DatabaseConnectionManager, singleton. Use getInstance() to get an instance of this


Field Summary
protected  int createdConnections
           
protected  java.sql.Driver driver
           
protected static DatabaseConnectionManager instance
           
protected  java.lang.Object lock
           
protected  int maxConnections
           
protected  java.lang.String password
           
protected  java.util.Properties props
           
protected  java.lang.String url
           
protected  java.lang.String username
           
 
Method Summary
protected  java.sql.Connection createNewConnection()
          Creates a new connection, using a username and password from props.
 void freeConnection(java.sql.Connection conn)
          Return used connection back
 java.sql.Connection getConnection()
          Returns a new connection
static DatabaseConnectionManager getInstance()
          Returns a singleton instance of pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static DatabaseConnectionManager instance

props

protected java.util.Properties props

driver

protected java.sql.Driver driver

createdConnections

protected int createdConnections

maxConnections

protected int maxConnections

url

protected java.lang.String url

username

protected java.lang.String username

password

protected java.lang.String password

lock

protected java.lang.Object lock
Method Detail

getInstance

public static DatabaseConnectionManager getInstance()
Returns a singleton instance of pool


freeConnection

public void freeConnection(java.sql.Connection conn)
Return used connection back


getConnection

public java.sql.Connection getConnection()
Returns a new connection


createNewConnection

protected java.sql.Connection createNewConnection()
Creates a new connection, using a username and password from props.