org.experlog.db
Class ESDataSourceWrapper

java.lang.Object
  extended by org.experlog.db.ESDataSourceWrapper
All Implemented Interfaces:
DataSourceWrapper

public class ESDataSourceWrapper
extends java.lang.Object
implements DataSourceWrapper

ESDataSourceWrapper is a dataSource wrapper. If there is a loaded datasource in jndi, this datasource is used. in other case, an ESDataSource is created (openeas dataSource) This wrapper only creates (or lookups) the dataSource, and do some delegation operations to the datasource method.


Field Summary
 int errorCount
           
 int maxCount
           
 
Constructor Summary
ESDataSourceWrapper(java.lang.String name)
          constructor no work is done here.
 
Method Summary
 void cleanup()
           
 int getCheckLevelObject()
           
 java.sql.Connection getConnection()
          get a connection from the datasource
 java.sql.Connection getConnection(java.lang.String _user, java.lang.String _password)
          get a connection from the datasource with a specific user and password properties
 javax.sql.DataSource getDataSource()
           
 java.lang.String getDataSourceName()
           
 java.lang.String getDriverName()
           
 int getErrorCount()
           
 java.lang.String getJdbcTestStmt()
           
 java.io.PrintWriter getLogWriter()
           
 int getMaxCon()
           
 int getMaxCount()
           
 int getMinCon()
           
 java.lang.String getPassword()
           
 java.util.Hashtable getPool()
           
 java.lang.String getUrl()
           
 java.util.Hashtable getUsedPool()
           
 java.lang.String getUser()
           
 void init(AppConfiguration shopConfig, DatasourceProperty dsprop)
          initialize the datasource wrapper,
 boolean isDebug()
           
 void removeLockedObject(org.enhydra.jdbc.pool.GenerationObject obj)
           
 void removeUnlockedObject(org.enhydra.jdbc.pool.GenerationObject obj)
           
 void setCheckLevelObject(int checkLevelObject)
           
 void setDataSourceName(java.lang.String name)
           
 void setDebug(boolean debug)
           
 void setJdbcTestStmt(java.lang.String jdbcTestStmt)
           
 void setLogWriter(java.io.PrintWriter log)
           
 void setMaxCon(int max)
           
 void setMinCon(int min)
           
 void setPassword(java.lang.String password)
           
 void setUser(java.lang.String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorCount

public int errorCount

maxCount

public int maxCount
Constructor Detail

ESDataSourceWrapper

public ESDataSourceWrapper(java.lang.String name)
constructor no work is done here.

Method Detail

init

public void init(AppConfiguration shopConfig,
                 DatasourceProperty dsprop)
          throws java.lang.Exception,
                 java.sql.SQLException
initialize the datasource wrapper,

Throws:
java.lang.Exception
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException,
                                         java.lang.Exception
get a connection from the datasource

Throws:
java.sql.SQLException
java.lang.Exception

getConnection

public java.sql.Connection getConnection(java.lang.String _user,
                                         java.lang.String _password)
                                  throws java.sql.SQLException,
                                         java.lang.Exception
get a connection from the datasource with a specific user and password properties

Throws:
java.sql.SQLException
java.lang.Exception

setDataSourceName

public void setDataSourceName(java.lang.String name)

getDataSourceName

public java.lang.String getDataSourceName()

getDataSource

public javax.sql.DataSource getDataSource()

getMinCon

public int getMinCon()

getMaxCon

public int getMaxCon()

getJdbcTestStmt

public java.lang.String getJdbcTestStmt()

getCheckLevelObject

public int getCheckLevelObject()

setMinCon

public void setMinCon(int min)

setMaxCon

public void setMaxCon(int max)

setJdbcTestStmt

public void setJdbcTestStmt(java.lang.String jdbcTestStmt)

setCheckLevelObject

public void setCheckLevelObject(int checkLevelObject)

setLogWriter

public void setLogWriter(java.io.PrintWriter log)

setDebug

public void setDebug(boolean debug)

setUser

public void setUser(java.lang.String user)

setPassword

public void setPassword(java.lang.String password)

getLogWriter

public java.io.PrintWriter getLogWriter()

isDebug

public boolean isDebug()

getUser

public java.lang.String getUser()

getPassword

public java.lang.String getPassword()

getUrl

public java.lang.String getUrl()

getDriverName

public java.lang.String getDriverName()

getMaxCount

public int getMaxCount()

getErrorCount

public int getErrorCount()

cleanup

public void cleanup()

getPool

public java.util.Hashtable getPool()

removeUnlockedObject

public void removeUnlockedObject(org.enhydra.jdbc.pool.GenerationObject obj)

getUsedPool

public java.util.Hashtable getUsedPool()

removeLockedObject

public void removeLockedObject(org.enhydra.jdbc.pool.GenerationObject obj)