org.firebirdsql.jdbc
Class FBDataSource
java.lang.Object
org.firebirdsql.jdbc.FBDataSource
- DataSource, Referenceable, Serializable
public class FBDataSource
extends java.lang.Object
implements DataSource, Serializable, Referenceable
The class FBDataSource
is a ConnectionFactory for jdbc
Connection objects. All work is delegated to a ConnectionManager.
Connection | getConnection() - Attempt to establish a database connection.
|
Connection | getConnection(String username, String password) - Attempt to establish a database connection.
|
PrintWriter | getLogWriter() - Get the log writer for this data source.
|
int | getLoginTimeout() - Gets the maximum time in seconds that this data source can wait
while attempting to connect to a database.
|
Reference | getReference() - Get the JNDI
Reference for this DataSource.
|
void | setLogWriter(PrintWriter out) - Set the log writer for this data source.
|
void | setLoginTimeout(int seconds) - Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database.
|
void | setReference(Reference ref) - Set the JNDI
Reference for this DataSource.
|
FBDataSource
public FBDataSource(ManagedConnectionFactory mcf,
ConnectionManager cm)
getConnection
public Connection getConnection()
throws SQLException
Attempt to establish a database connection.
- a Connection to the database
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
Attempt to establish a database connection.
username
- the database user on whose behalf the Connection is
being madepassword
- the user's password
- a Connection to the database
getLogWriter
public PrintWriter getLogWriter()
Get the log writer for this data source.
The log writer is a character output stream to which all logging
and tracing messages for this data source object instance will be
printed. This includes messages printed by the methods of this
object, messages printed by methods of other objects manufactured
by this object, and so on. Messages printed to a data source
specific log writer are not printed to the log writer associated
with the java.sql.Drivermanager class. When a DataSource object is
created the log writer is initially null, in other words, logging
is disabled.
- the log writer for this data source, null if disabled
getLoginTimeout
public int getLoginTimeout()
throws SQLException
Gets the maximum time in seconds that this data source can wait
while attempting to connect to a database. A value of zero
means that the timeout is the default system timeout
if there is one; otherwise it means that there is no timeout.
When a DataSource object is created the login timeout is
initially zero.
- the data source login time limit
getReference
public Reference getReference()
Get the JNDI Reference
for this DataSource.
setLogWriter
public void setLogWriter(PrintWriter out)
Set the log writer for this data source.
The log writer is a character output stream to which all logging
and tracing messages for this data source object instance will be
printed. This includes messages printed by the methods of this
object, messages printed by methods of other objects manufactured
by this object, and so on. Messages printed to a data source
specific log writer are not printed to the log writer associated
with the java.sql.Drivermanager class. When a DataSource object is
created the log writer is initially null, in other words, logging
is disabled.
out
- the new log writer; to disable, set to null
setLoginTimeout
public void setLoginTimeout(int seconds)
throws SQLException
Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database. A value of zero
specifies that the timeout is the default system timeout
if there is one; otherwise it specifies that there is no timeout.
When a DataSource object is created the login timeout is
initially zero.
seconds
- the data source login time limit
setReference
public void setReference(Reference ref)
Set the JNDI Reference
for this DataSource.
ref
- The JNDI reference for this DataSource
Copyright B) 2001 David Jencks and other authors. All rights reserved.