public abstract class BaseConnectionFactory extends Object implements ClosableDataSource
C3P0ConnectionFactory class.
Modifier | Constructor and Description |
---|---|
protected |
BaseConnectionFactory(InputStream stream,
String dsName) |
protected |
BaseConnectionFactory(String configFile,
String dsName) |
Modifier and Type | Method and Description |
---|---|
void |
close()
close
|
abstract Connection |
getConnection()
getConnection
|
abstract Connection |
getConnection(String username,
String password) |
abstract DataSource |
getDataSource()
getDataSource
|
abstract int |
getLoginTimeout()
getLoginTimeout
|
abstract PrintWriter |
getLogWriter()
getLogWriter
|
abstract String |
getUrl()
getUrl
|
abstract String |
getUser()
getUser
|
protected abstract void |
initializePool(JdbcDataSource ds) |
boolean |
isWrapperFor(Class<?> iface)
isWrapperFor
|
abstract void |
setLoginTimeout(int seconds)
How long, in seconds, to attempt to make a connection to the database.
|
abstract void |
setLogWriter(PrintWriter out) |
abstract void |
setUrl(String url)
setUrl
|
abstract void |
setUser(String user)
setUser
|
<T> T |
unwrap(Class<T> iface)
unwrap
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setIdleTimeout, setMaxPool, setMaxSize, setMinPool
getParentLogger
protected BaseConnectionFactory(InputStream stream, String dsName) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, PropertyVetoException, SQLException
stream
- A configuration file as an InputStream
.dsName
- The data source's name.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.PropertyVetoException
- if any.SQLException
- if any.protected BaseConnectionFactory(String configFile, String dsName) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, PropertyVetoException, SQLException
configFile
- A configuration file name.dsName
- The data source's name.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.PropertyVetoException
- if any.SQLException
- if any.protected abstract void initializePool(JdbcDataSource ds) throws SQLException
SQLException
public abstract Connection getConnection() throws SQLException
getConnection
getConnection
in interface DataSource
Connection
object.SQLException
- if any.public abstract DataSource getDataSource()
getDataSource
DataSource
object.public abstract Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public abstract PrintWriter getLogWriter() throws SQLException
getLogWriter
getLogWriter
in interface CommonDataSource
PrintWriter
object.SQLException
- if any.public abstract void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public abstract void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
setLoginTimeout
in interface ClosableDataSource
SQLException
public abstract int getLoginTimeout() throws SQLException
getLoginTimeout
getLoginTimeout
in interface CommonDataSource
SQLException
- if any.public void close() throws SQLException
close
close
in interface ClosableDataSource
SQLException
- if any.public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
unwrap
in interface Wrapper
T
- a T object.iface
- a Class
object.SQLException
- if any.public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
isWrapperFor
in interface Wrapper
iface
- a Class
object.SQLException
- if any.Copyright © 2015. All Rights Reserved.