public class JDBCFactoryObject extends java.lang.Object implements JDBCFactory
Title: Service Event Fabric Runtime
Description: Object that stores a JDBC connection factory.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Day, Hour, Minute, Second
Modifier and Type | Method and Description |
---|---|
DatabaseConnection |
createConnection()
Creates a default connection with a default name and credentials.
|
DatabaseConnection |
createConnection(java.lang.String connectionName)
Creates a connection using default credentials.
|
DatabaseConnection |
createConnection(java.lang.String connectionName,
java.lang.String userName,
java.lang.String password)
Creates a named connection and loads it into the reference list.
|
void |
destroyAll()
Cleans up all transient objects and frees up all resources created by this factory.
|
boolean |
existsProperty(java.lang.String name) |
boolean |
getAutoCommit()
Gets the default value for autoCommit mode of any created connection
|
java.lang.String |
getCatalog()
Gets the catalog of any created connection
|
long |
getConnectionCheckInterval()
Returns the number of milliseconds between checks of the connection's state.
|
int |
getConnectionTimeout()
Gets the number of seconds the connection attempt will wait before throwing
an exception.
|
java.lang.String |
getDefaultPassword()
Gets the default password.
|
java.lang.String |
getDefaultUser()
Gets the default user.
|
java.lang.String |
getDescription()
Returns the functional description of this factory.
|
FabricComponent |
getFabricComponent() |
java.lang.String |
getFactoryName()
Returns the name of the JDBC factory instance.
|
java.lang.String |
getFactoryType()
Returns the factory Type.
|
java.lang.String |
getFullName() |
int |
getHoldability()
Gets the holdability value of any created connection
|
java.lang.String |
getJDBCDriverClassName()
Returns the class name of the JDBC driver.
|
int |
getMajorVersion()
Returns the major version of the factory.
|
int |
getMinorVersion()
Returns the minor version of the factory
|
java.lang.String |
getPollingQuery()
Returns the interval of the polling.
|
java.util.Properties |
getProperties()
Returns JDBC driver properties
|
java.lang.String |
getProperty(java.lang.String name)
Returns the value of specified property for the JDBC driver.
|
int |
getQueryTimeout()
Gets the numbers of seconds to wait for a query to complete before throwing
an excpetion.
|
boolean |
getReadOnly()
Gets the readOnly mode of any created connection
|
long |
getReconnectInterval()
Returns the frequency at which to check the connection's state in milliseconds (when connection is in RECONNECT state).
|
int |
getReconnectRetries()
Returns the number of times a connection will try to reconnect.
|
javax.naming.Reference |
getReference() |
int |
getTransactionIsolation()
Gets the transaction isolation level of any created connection
|
java.lang.String |
getUrl()
Gets the default url.
|
java.lang.String |
getVendorString()
Returns the complete version string.
|
boolean |
isLifeCycleManaged()
Returns
true if the factory's connection life cycle is to be
managed by the Service Context. |
boolean |
isReliableConnection()
Returns
true if the connection created by the factory is
reliable. |
boolean |
isTransient() |
java.util.List |
listDriverProperties()
Returns a vector of
JDBC Driver Property Info objects. |
DatabaseConnection |
lookupConnection(java.lang.String connectionName)
Returns a reference to a connection in the local reference list.
|
void |
removeConnection(java.lang.String connectionName)
Removes the connection from the local reference list.
|
void |
setAutoCommit(boolean autoCommit)
Sets the default value for autoCommit mode of any created connection
|
void |
setCatalog(java.lang.String catalog)
Sets the catalog of any created connection
|
void |
setConnectionCheckInterval(long millis)
Sets the frequency at which to check the connection's state in milliseconds.
|
void |
setConnectionTimeout(int seconds)
Sets the number of seconds to wait for a successfull connection before throwing
an exception.
|
void |
setDefaultPassword(java.lang.String password)
Sets the default password
|
void |
setDefaultUser(java.lang.String userName)
Sets the default user.
|
void |
setDescription(java.lang.String desc)
Sets the functional description for this JDBC factory.
|
void |
setFabricComponent(FabricComponent component) |
void |
setFactoryName(java.lang.String name) |
void |
setFactoryType(java.lang.String type) |
void |
setHoldability(int holdability)
Sets the holdability value of any created connection.
|
void |
setJDBCDriverClassName(java.lang.String driverClassName) |
void |
setLifeCycleManaged(boolean managed)
Sets whether this factory's connection life cycle is managed by the
container context or not.
|
void |
setPollingQuery(java.lang.String query)
Sets the query which is executed to check whether DB Server is alive
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets the JDBC driver property to the specified value
|
void |
setQueryTimeout(int seconds)
Sets the numbers of seconds to wait for a query to complete before throwing
an excpetion.
|
void |
setReadOnly(boolean readOnly)
Sets the readOnly mode of any created connection.
|
void |
setReconnectInterval(long millis)
Sets the frequency at which to check the connection's state in milliseconds (when connection is in RECONNECT state).
|
void |
setReconnectRetries(int retry)
Sets the number of times that a reliable connection tries to reconnect.
|
void |
setReliableConnection(boolean reliable)
Specifies if the connection that is created will be reliable.
|
void |
setTransactionIsolation(int level)
Sets the transaction isolation level of any created connection.
|
void |
setUrl(java.lang.String connectionURL)
Sets the url for this factory.
|
java.lang.String |
toString() |
public boolean isTransient()
public void setFabricComponent(FabricComponent component)
public FabricComponent getFabricComponent()
public java.lang.String getDefaultPassword()
JDBCFactory
getDefaultPassword
in interface JDBCFactory
public void setDefaultPassword(java.lang.String password)
JDBCFactory
setDefaultPassword
in interface JDBCFactory
password
- Stringpublic java.lang.String getDefaultUser()
JDBCFactory
getDefaultUser
in interface JDBCFactory
public boolean isLifeCycleManaged()
JDBCFactory
true
if the factory's connection life cycle is to be
managed by the Service Context. When true
the connection will
be started (connected) implicitly as part of the
Service.init()
method. The connection is
established immediatley before method is invoked. If the connection
attempt results in a failure the service is put into suspended mode
on platforms that support this mode. Otherwise the service is placed into
stopped mode. If the factory defines a reliable connection the
connection's retry cycle completes prior to the Service transitioning into
a stopped or suspended mode.isLifeCycleManaged
in interface JDBCFactory
public boolean isReliableConnection()
JDBCFactory
true
if the connection created by the factory is
reliable.isReliableConnection
in interface JDBCFactory
public void setDefaultUser(java.lang.String userName)
JDBCFactory
setDefaultUser
in interface JDBCFactory
public void setFactoryName(java.lang.String name)
public void setLifeCycleManaged(boolean managed)
JDBCFactory
setLifeCycleManaged
in interface JDBCFactory
public void setReliableConnection(boolean reliable)
JDBCFactory
DatabaseSQLException
occurs.
The reconnect is attempted based on reconnection retries and timouts. If
the connection does not succeed the service is placed in a Suspended
state or Stopped state depending on what the service hosting environment
supports.setReliableConnection
in interface JDBCFactory
reliable
- booleanpublic javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public java.lang.String getPollingQuery()
JDBCFactory
getPollingQuery
in interface JDBCFactory
public int getReconnectRetries()
JDBCFactory
getReconnectRetries
in interface JDBCFactory
public void setPollingQuery(java.lang.String query)
JDBCFactory
setPollingQuery
in interface JDBCFactory
public void setReconnectRetries(int retry)
JDBCFactory
setReconnectRetries
in interface JDBCFactory
public void setProperty(java.lang.String name, java.lang.String value) throws JDBCConfigurationException
JDBCFactory
setProperty
in interface JDBCFactory
name
- Stringvalue
- StringJDBCConfigurationException
public java.lang.String getProperty(java.lang.String name)
JDBCFactory
getProperty
in interface JDBCFactory
name
- Stringpublic boolean existsProperty(java.lang.String name)
public java.util.Properties getProperties()
JDBCFactory
getProperties
in interface JDBCFactory
public DatabaseConnection createConnection() throws JDBCConfigurationException
createConnection
in interface JDBCFactory
SQLException
JDBCConfigurationException
public DatabaseConnection createConnection(java.lang.String connectionName) throws JDBCConfigurationException
JDBCFactory
createConnection
in interface JDBCFactory
JDBCConfigurationException
public DatabaseConnection createConnection(java.lang.String connectionName, java.lang.String userName, java.lang.String password) throws JDBCConfigurationException
JDBCFactory
JDBCFactory.lookupConnection(java.lang.String)
method.createConnection
in interface JDBCFactory
connectionName
- StringuserName
- Stringpassword
- StringJDBCConfigurationException
public int getConnectionTimeout()
JDBCFactory
getConnectionTimeout
in interface JDBCFactory
public void setConnectionTimeout(int seconds)
JDBCFactory
setConnectionTimeout
in interface JDBCFactory
seconds
- intpublic void setAutoCommit(boolean autoCommit)
JDBCFactory
setAutoCommit
in interface JDBCFactory
public void setCatalog(java.lang.String catalog)
JDBCFactory
setCatalog
in interface JDBCFactory
public void setHoldability(int holdability)
JDBCFactory
setHoldability
in interface JDBCFactory
public void setReadOnly(boolean readOnly)
JDBCFactory
setReadOnly
in interface JDBCFactory
public void setTransactionIsolation(int level)
JDBCFactory
Connection.TRANSACTION_NONE
Connection.TRANSACTION_READ_UNCOMMITTED
Connection.TRANSACTION_READ_COMMITTED
Connection.TRANSACTION_REPEATABLE_READ
Connection.TRANSACTION_SERIALIZABLE
setTransactionIsolation
in interface JDBCFactory
public boolean getAutoCommit()
JDBCFactory
getAutoCommit
in interface JDBCFactory
public java.lang.String getCatalog()
JDBCFactory
getCatalog
in interface JDBCFactory
public int getHoldability()
JDBCFactory
getHoldability
in interface JDBCFactory
public boolean getReadOnly()
JDBCFactory
getReadOnly
in interface JDBCFactory
public int getTransactionIsolation()
JDBCFactory
getTransactionIsolation
in interface JDBCFactory
public java.lang.String getFactoryName()
JDBCFactory
getFactoryName
in interface JDBCFactory
public java.lang.String getFactoryType()
JDBCFactory
getFactoryType
in interface JDBCFactory
public void setFactoryType(java.lang.String type)
public int getMajorVersion()
JDBCFactory
getMajorVersion
in interface JDBCFactory
public int getMinorVersion()
JDBCFactory
getMinorVersion
in interface JDBCFactory
public java.lang.String getVendorString()
JDBCFactory
getVendorString
in interface JDBCFactory
public void setUrl(java.lang.String connectionURL)
JDBCFactory
setUrl
in interface JDBCFactory
connectionURL
- Stringpublic java.lang.String getUrl()
JDBCFactory
getUrl
in interface JDBCFactory
public java.lang.String getJDBCDriverClassName()
JDBCFactory
getJDBCDriverClassName
in interface JDBCFactory
public void setJDBCDriverClassName(java.lang.String driverClassName)
public long getConnectionCheckInterval()
JDBCFactory
getConnectionCheckInterval
in interface JDBCFactory
public void setConnectionCheckInterval(long millis)
JDBCFactory
setConnectionCheckInterval
in interface JDBCFactory
millis
- longpublic long getReconnectInterval()
JDBCFactory
getReconnectInterval
in interface JDBCFactory
public void setReconnectInterval(long millis)
JDBCFactory
setReconnectInterval
in interface JDBCFactory
millis
- longpublic java.lang.String getDescription()
JDBCFactory
getDescription
in interface JDBCFactory
public void setDescription(java.lang.String desc)
JDBCFactory
setDescription
in interface JDBCFactory
desc
- Stringpublic java.util.List listDriverProperties() throws JDBCConfigurationException, RuntimeContextException
JDBCFactory
JDBC Driver Property Info
objects.listDriverProperties
in interface JDBCFactory
JDBCConfigurationException
RuntimeContextException
public void destroyAll() throws JDBCConfigurationException
JDBCFactory
destroyAll
in interface JDBCFactory
JDBCConfigurationException
public int getQueryTimeout()
JDBCFactory
getQueryTimeout
in interface JDBCFactory
public void setQueryTimeout(int seconds)
JDBCFactory
setQueryTimeout
in interface JDBCFactory
seconds
- intpublic void removeConnection(java.lang.String connectionName) throws JDBCConfigurationException
JDBCFactory
removeConnection
in interface JDBCFactory
connectionName
- StringJDBCConfigurationException
public DatabaseConnection lookupConnection(java.lang.String connectionName) throws JDBCConfigurationException
JDBCFactory
lookupConnection
in interface JDBCFactory
connectionName
- StringJDBCConfigurationException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getFullName()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.