org.opennms.netmgt.config
Class C3P0ConnectionFactory

java.lang.Object
  extended by org.opennms.netmgt.config.C3P0ConnectionFactory
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, ClosableDataSource

public class C3P0ConnectionFactory
extends Object
implements ClosableDataSource


Constructor Summary
protected C3P0ConnectionFactory(Reader rdr, String dsName)
           
protected C3P0ConnectionFactory(String configFile, String dsName)
           
 
Method Summary
 void close()
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 DataSource getDataSource()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 com.mchange.v2.c3p0.ComboPooledDataSource getPool()
           
 String getUrl()
           
 String getUser()
           
 boolean isWrapperFor(Class<?> iface)
           
static JdbcDataSource marshalDataSourceFromConfig(Reader rdr, String dsName)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setPool(com.mchange.v2.c3p0.ComboPooledDataSource pool)
           
 void setUrl(String url)
           
 void setUser(String user)
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C3P0ConnectionFactory

protected C3P0ConnectionFactory(Reader rdr,
                                String dsName)
                         throws org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException,
                                PropertyVetoException,
                                SQLException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
PropertyVetoException
SQLException

C3P0ConnectionFactory

protected C3P0ConnectionFactory(String configFile,
                                String dsName)
                         throws IOException,
                                org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException,
                                PropertyVetoException,
                                SQLException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
PropertyVetoException
SQLException
Method Detail

marshalDataSourceFromConfig

public static JdbcDataSource marshalDataSourceFromConfig(Reader rdr,
                                                         String dsName)
                                                  throws org.exolab.castor.xml.MarshalException,
                                                         org.exolab.castor.xml.ValidationException,
                                                         PropertyVetoException,
                                                         SQLException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
PropertyVetoException
SQLException

getConnection

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

getPool

public com.mchange.v2.c3p0.ComboPooledDataSource getPool()

setPool

public void setPool(com.mchange.v2.c3p0.ComboPooledDataSource pool)

getUrl

public String getUrl()

setUrl

public void setUrl(String url)

getUser

public String getUser()

setUser

public void setUser(String user)

getDataSource

public DataSource getDataSource()

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

close

public void close()
           throws SQLException
Specified by:
close in interface ClosableDataSource
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException


Copyright © 2009. All Rights Reserved.