org.synchronoss.cpo.jdbc
Class ClassJdbcDataSourceInfo

java.lang.Object
  extended by org.synchronoss.cpo.AbstractDataSourceInfo
      extended by org.synchronoss.cpo.jdbc.AbstractJdbcDataSourceInfo
          extended by org.synchronoss.cpo.jdbc.AbstractJdbcDataSource
              extended by org.synchronoss.cpo.jdbc.ClassJdbcDataSourceInfo
All Implemented Interfaces:
Wrapper, EventListener, CommonDataSource, ConnectionEventListener, DataSource, DataSourceInfo

public class ClassJdbcDataSourceInfo
extends AbstractJdbcDataSource
implements ConnectionEventListener

Collects the info required to instantiate a DataSource from a JDBC Driver Provides the DataSourceInfo factory method getDataSource which instantiates the DataSource

Author:
dberry

Constructor Summary
ClassJdbcDataSourceInfo(String className, SortedMap<String,String> properties)
          Creates a ClassJdbcDataSourceInfo from a Jdbc Driver
 
Method Summary
 void connectionClosed(ConnectionEvent ce)
           
 void connectionErrorOccurred(ConnectionEvent ce)
           
protected  DataSource createDataSource()
           
protected  void finalize()
           
 Connection getConnection()
           
 String toString()
           
 
Methods inherited from class org.synchronoss.cpo.jdbc.AbstractJdbcDataSource
getConnection, getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
 
Methods inherited from class org.synchronoss.cpo.AbstractDataSourceInfo
getDataSource, getDataSourceName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassJdbcDataSourceInfo

public ClassJdbcDataSourceInfo(String className,
                               SortedMap<String,String> properties)
                        throws CpoException
Creates a ClassJdbcDataSourceInfo from a Jdbc Driver

Parameters:
classname - The classname of a class that implements datasource
properties - - The connection properties for connecting to the database
Throws:
CpoException
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

toString

public String toString()
Overrides:
toString in class Object

createDataSource

protected DataSource createDataSource()
                               throws CpoException
Specified by:
createDataSource in class AbstractDataSourceInfo
Throws:
CpoException

connectionClosed

public void connectionClosed(ConnectionEvent ce)
Specified by:
connectionClosed in interface ConnectionEventListener

connectionErrorOccurred

public void connectionErrorOccurred(ConnectionEvent ce)
Specified by:
connectionErrorOccurred in interface ConnectionEventListener

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2014. All Rights Reserved.