org.opennms.netmgt.config
Class C3P0ConnectionFactory
java.lang.Object
org.opennms.netmgt.config.C3P0ConnectionFactory
- All Implemented Interfaces:
- Wrapper, CommonDataSource, DataSource, ClosableDataSource
public class C3P0ConnectionFactory
- extends Object
- implements ClosableDataSource
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.