public class C3P0ConnectionFactory extends BaseConnectionFactory
C3P0ConnectionFactory class.
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
C3P0ConnectionFactory(JdbcDataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
void |
close()
close
|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
DataSource |
getDataSource()
getDataSource
|
int |
getLoginTimeout()
getLoginTimeout
|
PrintWriter |
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, validateJdbcUrl
public C3P0ConnectionFactory(JdbcDataSource dataSource) throws PropertyVetoException, SQLException
PropertyVetoException
SQLException
protected void initializePool(JdbcDataSource dataSource) throws SQLException
initializePool
in class BaseConnectionFactory
SQLException
public Connection getConnection() throws SQLException
SQLException
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
SQLException
public PrintWriter getLogWriter() throws SQLException
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
SQLException
public void setLoginTimeout(int seconds) throws SQLException
ClosableDataSource
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()
BaseConnectionFactory
close
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ClosableDataSource
close
in class BaseConnectionFactory
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 © 2018. All rights reserved.