public class C3P0ConnectionFactory extends BaseConnectionFactory
C3P0ConnectionFactory class.
| Constructor and Description |
|---|
C3P0ConnectionFactory(InputStream stream,
String dsName) |
C3P0ConnectionFactory(String configFile,
String dsName) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close
|
Connection |
getConnection()
getConnection
|
Connection |
getConnection(String username,
String password) |
DataSource |
getDataSource()
getDataSource
|
int |
getLoginTimeout()
getLoginTimeout
|
PrintWriter |
getLogWriter()
getLogWriter
|
Logger |
getParentLogger() |
String |
getUrl()
getUrl
|
String |
getUser()
getUser
|
protected void |
initializePool(JdbcDataSource dataSource) |
void |
setIdleTimeout(int idleTimeout)
How long, in seconds, an idle connection is kept in the pool before it is removed.
|
void |
setLoginTimeout(int seconds)
How long, in seconds, to attempt to make a connection to the database.
|
void |
setLogWriter(PrintWriter out) |
void |
setMaxPool(int maxPool)
The maximum number of pooled connections to retain.
|
void |
setMaxSize(int maxSize)
The maximum number of connections that can be created.
|
void |
setMinPool(int minPool)
The minimum number of pooled connections to retain.
|
void |
setUrl(String url)
setUrl
|
void |
setUser(String user)
setUser
|
isWrapperFor, unwrappublic C3P0ConnectionFactory(InputStream stream, String dsName) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, PropertyVetoException, SQLException
org.exolab.castor.xml.MarshalExceptionorg.exolab.castor.xml.ValidationExceptionPropertyVetoExceptionSQLExceptionpublic C3P0ConnectionFactory(String configFile, String dsName) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, PropertyVetoException, SQLException
IOExceptionorg.exolab.castor.xml.MarshalExceptionorg.exolab.castor.xml.ValidationExceptionPropertyVetoExceptionSQLExceptionprotected void initializePool(JdbcDataSource dataSource) throws SQLException
initializePool in class BaseConnectionFactorySQLExceptionpublic Connection getConnection() throws SQLException
BaseConnectionFactorygetConnection
getConnection in interface DataSourcegetConnection in class BaseConnectionFactoryConnection object.SQLException - if any.public String getUrl()
BaseConnectionFactorygetUrl
getUrl in class BaseConnectionFactoryString object.public void setUrl(String url)
BaseConnectionFactorysetUrl
setUrl in class BaseConnectionFactoryurl - a String object.public String getUser()
BaseConnectionFactorygetUser
getUser in class BaseConnectionFactoryString object.public void setUser(String user)
BaseConnectionFactorysetUser
setUser in class BaseConnectionFactoryuser - a String object.public DataSource getDataSource()
BaseConnectionFactorygetDataSource
getDataSource in class BaseConnectionFactoryDataSource object.public Connection getConnection(String username, String password) throws SQLException
BaseConnectionFactorygetConnection in interface DataSourcegetConnection in class BaseConnectionFactorySQLExceptionpublic PrintWriter getLogWriter() throws SQLException
BaseConnectionFactorygetLogWriter
getLogWriter in interface CommonDataSourcegetLogWriter in class BaseConnectionFactoryPrintWriter object.SQLException - if any.public void setLogWriter(PrintWriter out) throws SQLException
BaseConnectionFactorysetLogWriter in interface CommonDataSourcesetLogWriter in class BaseConnectionFactorySQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
BaseConnectionFactorysetLoginTimeout in interface CommonDataSourcesetLoginTimeout in interface ClosableDataSourcesetLoginTimeout in class BaseConnectionFactorySQLExceptionpublic int getLoginTimeout()
throws SQLException
BaseConnectionFactorygetLoginTimeout
getLoginTimeout in interface CommonDataSourcegetLoginTimeout in class BaseConnectionFactorySQLException - if any.public Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedExceptionpublic void close()
throws SQLException
BaseConnectionFactoryclose
close in interface ClosableDataSourceclose in class BaseConnectionFactorySQLException - if any.public void setIdleTimeout(int idleTimeout)
ClosableDataSourcepublic void setMinPool(int minPool)
ClosableDataSourcepublic void setMaxPool(int maxPool)
ClosableDataSourcepublic void setMaxSize(int maxSize)
ClosableDataSourceCopyright © 2015. All Rights Reserved.