|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.services.sql.connection.StandaloneConnectionFactory
A Factory for JDBC Connections. Hides interaction with the JDBC driver. Maintains a reference to a JDBC Driver, plus connection info (userId, password, URL). Note that the Driver instance is discarded and recreated each time the component is configured. Copyright 2002 Sapient
StandaloneConnectionFactoryConfiguration
Field Summary | |
protected Properties |
dbConnectionProperties
The properties passed to the JDBC driver to obtain a connection. |
protected String |
dbUrl
The JDBC connection URL for the database. |
protected Driver |
driver
A reference to the database driver. |
private org.apache.commons.logging.Log |
log
Provides a handle to Apache-commons logger |
protected static String |
PASSWORD_KEY
The environment key for the password to authenticate a database connection with. |
protected static String |
USER_KEY
The environment key for the username to authenticate a database connection with. |
Constructor Summary | |
StandaloneConnectionFactory()
|
Method Summary | |
void |
configure(ComponentConfiguration configuration)
Configure the component. |
Connection |
getConnection()
Uses the configured JDBC Driver and connection parameters to return a JDBC connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String USER_KEY
protected static final String PASSWORD_KEY
protected Driver driver
configure(...)
.
protected String dbUrl
protected Properties dbConnectionProperties
private org.apache.commons.logging.Log log
Constructor Detail |
public StandaloneConnectionFactory()
Method Detail |
public Connection getConnection() throws SQLException
getConnection
in interface ConnectionFactory
SQLException
- indicates an error creating the connection
to the datasourcepublic void configure(ComponentConfiguration configuration)
configure
in interface Configurable
configuration
- A StandaloneConnectionFactoryConfiguration instance
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |