Package org.firebirdsql.jdbc
Class FBDataSource
- java.lang.Object
-
- org.firebirdsql.ds.RootCommonDataSource
-
- org.firebirdsql.jdbc.FBDataSource
-
- All Implemented Interfaces:
java.io.Serializable
,java.sql.Wrapper
,javax.naming.Referenceable
,javax.resource.Referenceable
,javax.sql.CommonDataSource
,javax.sql.DataSource
public class FBDataSource extends RootCommonDataSource implements javax.sql.DataSource, java.io.Serializable, javax.resource.Referenceable
The classFBDataSource
is a ConnectionFactory for jdbc Connection objects. All work is delegated to a ConnectionManager.- Version:
- 1.0
- Author:
- David Jencks
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FBDataSource(javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm)
FBDataSource(FBManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.Connection
getConnection()
java.sql.Connection
getConnection(java.lang.String username, java.lang.String password)
int
getLoginTimeout()
javax.naming.Reference
getReference()
Get the JNDIReference
for this DataSource.boolean
isWrapperFor(java.lang.Class<?> iface)
void
setLoginTimeout(int seconds)
void
setReference(javax.naming.Reference ref)
Set the JNDIReference
for this DataSource.<T> T
unwrap(java.lang.Class<T> iface)
-
Methods inherited from class org.firebirdsql.ds.RootCommonDataSource
getLogWriter, getParentLogger, setLogWriter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
FBDataSource
public FBDataSource(javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm)
-
FBDataSource
public FBDataSource(FBManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm)
-
-
Method Detail
-
setReference
public void setReference(javax.naming.Reference ref)
Set the JNDIReference
for this DataSource.- Specified by:
setReference
in interfacejavax.resource.Referenceable
- Parameters:
ref
- The JNDI reference for this DataSource
-
getReference
public javax.naming.Reference getReference()
Get the JNDIReference
for this DataSource.- Specified by:
getReference
in interfacejavax.naming.Referenceable
- Returns:
- The JNDI reference
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
- Specified by:
getConnection
in interfacejavax.sql.DataSource
- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
- Specified by:
getConnection
in interfacejavax.sql.DataSource
- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws java.sql.SQLException
- Specified by:
setLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
setLoginTimeout
in interfacejavax.sql.DataSource
- Throws:
java.sql.SQLException
-
getLoginTimeout
public int getLoginTimeout() throws java.sql.SQLException
- Specified by:
getLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
getLoginTimeout
in interfacejavax.sql.DataSource
- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
- Specified by:
isWrapperFor
in interfacejava.sql.Wrapper
- Throws:
java.sql.SQLException
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
- Specified by:
unwrap
in interfacejava.sql.Wrapper
- Throws:
java.sql.SQLException
-
-