|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.firebirdsql.pool.FBWrappingDataSource
Implementation of DataSource
including connection pooling.
Following properties are supported:
blobBufferSize
size of the buffer used to transfer BLOB data.
blockingTimeout
time in milliseconds during which
getConnection()
method will block if no free connection is in pool.
database
path to a database including the server name;
for example localhost/3050:c:/path/to/database.gdb
.
encoding
character encoding for the JDBC connection.
idleTimeout
time in milliseconds after which
idle physical connection in the pool is closed.
loginTimeout
property from DataSource
,
in this context is a synonym for blockingTimeout
(however
value is specified in seconds).
maxSize
maximum number of physical connections that can
be opened by this data source.
minSize
minimum number of connections that will remain open
by this data source.
password
password that is used to connect to database.
pingInterval
time interval during which connection will
be proved for aliveness.
socketBufferSize
size of the socket buffer in bytes. In some
cases values used by JVM by default are not optimal. This results in
performance degradation (especially when you transfer big BLOBs). Usually
8192 bytes provides good results.
sqlRole
SQL role name.
tpbMapping
mapping of the TPB parameters to JDBC transaction
isolation levels.
type
type of connection that will be created. There are
three possible types: pure Java (or type 4), type 2 that will use Firebird
client library to connect to the database, and embedded that will use
embedded engine (access to local databases). Possible values are (case
insensitive):
"PURE_JAVA"
or "TYPE4"
for pure Java (type 4)
JDBC connections;
"NATIVE"
or "TYPE2"
to use Firebird client
library;
"EMBEDDED"
to use embedded engine.
userName
name of the user that will be used to access the
database.
Constructor Summary | |
FBWrappingDataSource()
Create instance of this class. |
Method Summary | |
protected void |
finalize()
Finalize this instance. |
int |
getBlobBufferSize()
|
int |
getBlockingTimeout()
|
java.lang.String |
getCharSet()
|
java.sql.Connection |
getConnection()
Get JDBC connection from this data source. |
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String password)
Get JDBC connection for the specified user name and password. |
int |
getConnectionCount()
|
java.lang.String |
getDatabase()
|
javax.naming.Reference |
getDefaultReference()
Get default JNDI reference for this datasource. |
java.lang.String |
getDescription()
|
java.lang.String |
getEncoding()
|
int |
getIdleTimeout()
|
int |
getIdleTimeoutMinutes()
|
int |
getLoginTimeout()
Get login timeout. |
java.io.PrintWriter |
getLogWriter()
Get log writer. |
int |
getMaxSize()
|
int |
getMinSize()
|
java.lang.String |
getNonStandardProperty(java.lang.String key)
|
java.lang.Object |
getObjectInstance(java.lang.Object obj,
javax.naming.Name name,
javax.naming.Context nameCtx,
java.util.Hashtable environment)
Get object instance for the specified name in the specified context. |
java.lang.String |
getPassword()
|
int |
getPingInterval()
|
boolean |
getPooling()
|
javax.naming.Reference |
getReference()
Get JDNI reference. |
int |
getSocketBufferSize()
|
java.lang.String |
getSqlRole()
|
java.lang.String |
getTpbMapping()
|
java.lang.String |
getType()
|
java.lang.String |
getUserName()
|
void |
setBlobBufferSize(int blobBufferSizeValue)
|
void |
setBlockingTimeout(int blockingTimeoutValue)
|
void |
setCharSet(java.lang.String charSet)
|
void |
setDatabase(java.lang.String databaseValue)
|
void |
setDescription(java.lang.String descriptionValue)
|
void |
setEncoding(java.lang.String encodingValue)
|
void |
setIdleTimeout(int idleTimeoutValue)
|
void |
setIdleTimeoutMinutes(int timeout)
|
void |
setLoginTimeout(int seconds)
Set login timeout. |
void |
setLogWriter(java.io.PrintWriter printWriter)
Set log writer. |
void |
setMaxSize(int maxSizeValue)
|
void |
setMinSize(int minSizeValue)
|
void |
setNonStandardProperty(java.lang.String key,
java.lang.String value)
|
void |
setPassword(java.lang.String passwordValue)
|
void |
setPingInterval(int pingIntervalValue)
|
void |
setPooling(boolean pooling)
|
void |
setReference(javax.naming.Reference reference)
Set JNDI reference for this data source. |
void |
setSocketBufferSize(int socketBufferSize)
|
void |
setSqlRole(java.lang.String sqlRole)
|
void |
setTpbMapping(java.lang.String tpbMappingValue)
|
void |
setType(java.lang.String typeValue)
|
void |
setUserName(java.lang.String userNameValue)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FBWrappingDataSource() throws java.sql.SQLException
Method Detail |
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
- if something went wrong.public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
Connection
.
java.sql.SQLException
- if connection cannot be obtained due to some reason.public java.sql.Connection getConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
- if something went wrong.public int getLoginTimeout()
getLoginTimeout
in interface javax.sql.DataSource
public java.io.PrintWriter getLogWriter()
getLogWriter
in interface javax.sql.DataSource
PrintWriter
.public void setLoginTimeout(int seconds)
setLoginTimeout
in interface javax.sql.DataSource
seconds
- login timeout.public void setLogWriter(java.io.PrintWriter printWriter)
setLogWriter
in interface javax.sql.DataSource
printWriter
- instance of PrintWriter
.public int getBlockingTimeout()
public void setBlockingTimeout(int blockingTimeoutValue)
public java.lang.String getDatabase()
public void setDatabase(java.lang.String databaseValue)
public java.lang.String getDescription()
public void setDescription(java.lang.String descriptionValue)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encodingValue)
public java.lang.String getCharSet()
public void setCharSet(java.lang.String charSet) throws java.sql.SQLException
java.sql.SQLException
public int getIdleTimeout()
public void setIdleTimeout(int idleTimeoutValue)
public int getMaxSize()
public void setMaxSize(int maxSizeValue)
public int getMinSize()
public void setMinSize(int minSizeValue)
public java.lang.String getPassword()
public void setPassword(java.lang.String passwordValue)
public java.lang.String getTpbMapping()
public void setTpbMapping(java.lang.String tpbMappingValue)
public java.lang.String getUserName()
public void setUserName(java.lang.String userNameValue)
public int getBlobBufferSize()
public void setBlobBufferSize(int blobBufferSizeValue)
public java.lang.String getType()
public void setType(java.lang.String typeValue) throws java.sql.SQLException
java.sql.SQLException
public int getPingInterval()
public void setPingInterval(int pingIntervalValue)
public int getSocketBufferSize()
public java.lang.String getSqlRole()
public void setSocketBufferSize(int socketBufferSize)
public void setSqlRole(java.lang.String sqlRole)
public java.lang.String getNonStandardProperty(java.lang.String key)
public void setNonStandardProperty(java.lang.String key, java.lang.String value)
public boolean getPooling()
public void setPooling(boolean pooling)
public int getIdleTimeoutMinutes()
public void setIdleTimeoutMinutes(int timeout)
public int getConnectionCount() throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment) throws java.lang.Exception
obj
represents
Reference
, whose factory class is equal to this class.
getObjectInstance
in interface javax.naming.spi.ObjectFactory
java.lang.Exception
public javax.naming.Reference getReference()
getReference
in interface javax.naming.Referenceable
Reference
.public void setReference(javax.naming.Reference reference)
setReference
in interface javax.resource.Referenceable
reference
- JNDI reference.public javax.naming.Reference getDefaultReference()
Reference
containing all information
that allows to reconstruct the datasource.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |