|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.firebirdsql.pool.FBSimpleDataSource
This is a simple implementation of DataSource
interface. Connections
are physically opened in DataSource.getConnection()
method and
physically closed in Connection.close()
method. If you need connection
pooling, use FBWrappingDataSource
instead.
Field Summary | |
protected java.lang.String |
description
|
protected FBDataSource |
ds
|
protected javax.naming.Reference |
jndiReference
|
protected java.io.PrintWriter |
log
|
protected int |
loginTimeout
|
protected FBManagedConnectionFactory |
mcf
|
protected java.lang.String |
tpbMapping
|
Constructor Summary | |
FBSimpleDataSource()
Create instance of this class. |
|
FBSimpleDataSource(GDSType type)
Create instance of this class. |
Method Summary | |
java.lang.Integer |
getBlobBufferLength()
Get buffer length for the BLOB fields. |
java.sql.Connection |
getConnection()
Get JDBC connection with default credentials. |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Get JDBC connection with the specified credentials. |
java.lang.String |
getDatabase()
Get name of the database. |
java.lang.String |
getDatabaseName()
Deprecated. use getDatabase() instead for the sake of naming
compatibility. |
protected javax.sql.DataSource |
getDataSource()
Get underlying connection factory (in our case instance of FBDataSource class) that will provide JDBC connections. |
java.lang.String |
getDescription()
Get description of this datasource. |
java.lang.String |
getEncoding()
Get encoding for connections produced by this data source. |
int |
getLoginTimeout()
Get login timeout specified for this datasource. |
java.io.PrintWriter |
getLogWriter()
Get log for this datasource. |
java.lang.String |
getPassword()
Get password used in getConnection() method. |
javax.naming.Reference |
getReference()
Get previously set JNDI reference. |
java.lang.String |
getTpbMapping()
|
java.lang.String |
getUser()
Deprecated. use getUserName() instead for the sake of naming
compatibility. |
java.lang.String |
getUserName()
Get user name that is used in getConnection() method. |
void |
setBlobBufferLength(java.lang.Integer length)
Set BLOB buffer length. |
void |
setDatabase(java.lang.String name)
Set database name. |
void |
setDatabaseName(java.lang.String name)
Deprecated. use setDatabase(String) instead for the sake of
naming compatibility. |
void |
setDescription(java.lang.String description)
Set description of this datasource. |
void |
setEncoding(java.lang.String encoding)
Set encoding for connections produced by this data source. |
void |
setLoginTimeout(int loginTimeout)
Set login timeout for this datasource. |
void |
setLogWriter(java.io.PrintWriter log)
Set log for this datasource. |
void |
setPassword(java.lang.String password)
Set password that will be used in the getConnection() method. |
void |
setReference(javax.naming.Reference reference)
Set JNDI reference for this data source. |
void |
setTpbMapping(java.lang.String tpbMapping)
|
void |
setUser(java.lang.String user)
Deprecated. use setUserName(String) instead for the sake of
naming compatibility. |
void |
setUserName(java.lang.String userName)
Set user name that will be used in getConnection() method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient FBManagedConnectionFactory mcf
protected transient FBDataSource ds
protected transient java.io.PrintWriter log
protected javax.naming.Reference jndiReference
protected java.lang.String description
protected int loginTimeout
protected java.lang.String tpbMapping
Constructor Detail |
public FBSimpleDataSource()
public FBSimpleDataSource(GDSType type)
Method Detail |
public java.lang.Integer getBlobBufferLength()
public void setBlobBufferLength(java.lang.Integer length)
length
- new length of the BLOB buffer.public java.lang.String getDatabaseName()
getDatabase()
instead for the sake of naming
compatibility.
jdbc:firebirdsql:
part.public void setDatabaseName(java.lang.String name)
setDatabase(String)
instead for the sake of
naming compatibility.
name
- connection URL without "jdbc:firebirdsql:"
prefix ("//localhost:3050/c:/database/employee.gdb"
) for
example).public java.lang.String getDatabase()
jdbc:firebirdsql:
part.public void setDatabase(java.lang.String name)
name
- connection URL without "jdbc:firebirdsql:"
prefix ("//localhost:3050/c:/database/employee.gdb"
) for
example).public java.lang.String getUser()
getUserName()
instead for the sake of naming
compatibility.
getConnection()
method.
public void setUser(java.lang.String user)
setUserName(String)
instead for the sake of
naming compatibility.
getConnection()
method.
user
- default user name.public java.lang.String getUserName()
getConnection()
method.
public void setUserName(java.lang.String userName)
getConnection()
method.
userName
- default user name.public java.lang.String getPassword()
getConnection()
method.
getUserName()
.public void setPassword(java.lang.String password)
getConnection()
method.
password
- password corresponding to the user name set in
setUserName(String)
.public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
encoding
- encoding for the connection.public java.lang.String getTpbMapping()
public void setTpbMapping(java.lang.String tpbMapping) throws FBResourceException
FBResourceException
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
Reference
set previously.
javax.naming.NamingException
- if something went wrong.public void setReference(javax.naming.Reference reference)
setReference
in interface javax.resource.Referenceable
reference
- reference to set.public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
- if something went wrong.public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
username
- user name for the connection.password
- password for the connection.
java.sql.SQLException
- if something went wrong.public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
- if something went wrong.public void setLogWriter(java.io.PrintWriter log) throws java.sql.SQLException
setLogWriter
in interface javax.sql.DataSource
log
- instance of PrintWriter
that should be associated
with this datasource.
java.sql.SQLException
- if something went wrong.public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
- if something went wrong.public void setLoginTimeout(int loginTimeout) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.DataSource
loginTimeout
- login timeout in seconds.
java.sql.SQLException
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- description of this datasource.protected javax.sql.DataSource getDataSource() throws java.sql.SQLException
FBDataSource
class) that will provide JDBC connections.
java.sql.SQLException
- if something went wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |