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, unwrap
public C3P0ConnectionFactory(InputStream stream, String dsName) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, PropertyVetoException, SQLException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
PropertyVetoException
SQLException
public C3P0ConnectionFactory(String configFile, String dsName) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, PropertyVetoException, SQLException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
PropertyVetoException
SQLException
protected void initializePool(JdbcDataSource dataSource) throws SQLException
initializePool
in class BaseConnectionFactory
SQLException
public Connection getConnection() throws SQLException
BaseConnectionFactory
getConnection
getConnection
in interface DataSource
getConnection
in class BaseConnectionFactory
Connection
object.SQLException
- if any.public String getUrl()
BaseConnectionFactory
getUrl
getUrl
in class BaseConnectionFactory
String
object.public void setUrl(String url)
BaseConnectionFactory
setUrl
setUrl
in class BaseConnectionFactory
url
- a String
object.public String getUser()
BaseConnectionFactory
getUser
getUser
in class BaseConnectionFactory
String
object.public void setUser(String user)
BaseConnectionFactory
setUser
setUser
in class BaseConnectionFactory
user
- a String
object.public DataSource getDataSource()
BaseConnectionFactory
getDataSource
getDataSource
in class BaseConnectionFactory
DataSource
object.public Connection getConnection(String username, String password) throws SQLException
BaseConnectionFactory
getConnection
in interface DataSource
getConnection
in class BaseConnectionFactory
SQLException
public PrintWriter getLogWriter() throws SQLException
BaseConnectionFactory
getLogWriter
getLogWriter
in interface CommonDataSource
getLogWriter
in class BaseConnectionFactory
PrintWriter
object.SQLException
- if any.public void setLogWriter(PrintWriter out) throws SQLException
BaseConnectionFactory
setLogWriter
in interface CommonDataSource
setLogWriter
in class BaseConnectionFactory
SQLException
public void setLoginTimeout(int seconds) throws SQLException
BaseConnectionFactory
setLoginTimeout
in interface CommonDataSource
setLoginTimeout
in interface ClosableDataSource
setLoginTimeout
in class BaseConnectionFactory
SQLException
public int getLoginTimeout() throws SQLException
BaseConnectionFactory
getLoginTimeout
getLoginTimeout
in interface CommonDataSource
getLoginTimeout
in class BaseConnectionFactory
SQLException
- if any.public Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
public void close() throws SQLException
BaseConnectionFactory
close
close
in interface ClosableDataSource
close
in class BaseConnectionFactory
SQLException
- if any.public void setIdleTimeout(int idleTimeout)
ClosableDataSource
public void setMinPool(int minPool)
ClosableDataSource
public void setMaxPool(int maxPool)
ClosableDataSource
public void setMaxSize(int maxSize)
ClosableDataSource
Copyright © 2015. All Rights Reserved.