org.openejb.resource.jdbc
Class JdbcConnectionFactory
java.lang.Object
org.openejb.resource.jdbc.JdbcConnectionFactory
- All Implemented Interfaces:
- Serializable, Referenceable, DataSource
public class JdbcConnectionFactory
- extends Object
- implements DataSource, javax.resource.Referenceable, Serializable
As a connection factory the JdbcConnecitonFactory must implement the
Serializable and Referenceable methods so that it can be store in a
JNDI name space. The reference itself is an application specific object
that can be used to lookup and configure a new ManagedConnectionFactory
the JdbcConnecitonFactory is only a store for this reference, its not
expected to be functional after it has been serialized into a JNDI
namespace.
See section 10.5.3 of the J2EE Connector Architecture 1.0 spec.
- See Also:
- Serialized Form
Constructor Summary |
JdbcConnectionFactory(javax.resource.spi.ManagedConnectionFactory managedConnectionFactory,
javax.resource.spi.ConnectionManager connectionManager,
String jdbcUrl,
String jdbcDriver,
String defaultPassword,
String defaultUserName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JdbcConnectionFactory
public JdbcConnectionFactory(javax.resource.spi.ManagedConnectionFactory managedConnectionFactory,
javax.resource.spi.ConnectionManager connectionManager,
String jdbcUrl,
String jdbcDriver,
String defaultPassword,
String defaultUserName)
throws javax.resource.ResourceException
- Throws:
javax.resource.ResourceException
setReference
public void setReference(Reference jndiReference)
- setReference is called by deployment code
- Parameters:
jndiReference
-
getReference
public Reference getReference()
- getReference is called by JNDI provider during Context.bind
- Specified by:
getReference
in interface Referenceable
- Returns:
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection
in interface DataSource
- Throws:
SQLException
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
- Specified by:
getConnection
in interface DataSource
- Throws:
SQLException
getConnection
protected Connection getConnection(JdbcConnectionRequestInfo connectionRequestInfo)
throws SQLException
- Throws:
SQLException
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeout
in interface DataSource
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interface DataSource
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeout
in interface DataSource
setLogWriter
public void setLogWriter(PrintWriter out)
- Specified by:
setLogWriter
in interface DataSource
Copyright © 1999-2010 OpenEJB. All Rights Reserved.