public class ConnectionInfo extends HashStructureAdapter
_hash
Constructor and Description |
---|
ConnectionInfo(java.lang.String qualifiedName)
Creates a new, standalone connection info.
|
ConnectionInfo(java.lang.String store,
java.lang.String conn)
Creates a new, standalone connection info.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection()
Returns a JDBC Connection for the connection.
|
static ConnectionInfo |
getConnectionInfo(PropertyStorage ps)
Retrieves the connection information from the given property storage.
|
static ConnectionInfo |
getConnectionInfo(PropertyStorage ps,
java.lang.String key)
Retrieves the ConnectionInfo from the given PropertyStorage using the given
key.
|
java.lang.String |
getConnectionName()
Gets the name of the connection.
|
Database |
getDatabase()
Returns a Database for the connection.
|
DBObjectProviderID |
getProviderID()
Gets the DBObjectProviderID for the Database wrapping the described
connection.
|
java.lang.String |
getQualifiedName()
Gets the qualified name of the connection - i.e.
|
DatabaseProvider |
getReferenceable()
Gets the Referenceable implementation for the chosen database connection
from the underlying naming context.
|
java.lang.String |
getStoreName()
Gets the name of the connection store the connection is from.
|
boolean |
isValid()
Returns true if the encapsulated connection information points to an actual
connection (i.e.
|
void |
setConnectionName(java.lang.String conn)
Sets the name of the connection.
|
void |
setQualifiedName(java.lang.String qualifiedName)
Sets the store and connection name by using the given qualified name.
|
void |
setStoreName(java.lang.String store)
Sets the name of the connection store the connection is from.
|
java.lang.String |
toString() |
addStructureChangeListener, containsKey, copyTo, copyToImpl, equals, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
public ConnectionInfo(java.lang.String store, java.lang.String conn)
getConnectionInfo(PropertyStorage)
and
getConnectionInfo(PropertyStorage,String)
.store
- the name of the store the connection is inconn
- the name of the connectionpublic ConnectionInfo(java.lang.String qualifiedName)
getConnectionInfo(PropertyStorage)
and
getConnectionInfo(PropertyStorage,String)
.qualifiedName
- the fully qualified connection name
(see Database.getQualifiedName()
)public java.lang.String getStoreName()
public void setStoreName(java.lang.String store)
public java.lang.String getConnectionName()
public void setConnectionName(java.lang.String conn)
public java.lang.String getQualifiedName()
public void setQualifiedName(java.lang.String qualifiedName)
qualifiedName
- if null this clears the store and connection names.public DBObjectProviderID getProviderID()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isValid()
public DatabaseProvider getReferenceable()
public java.sql.Connection getConnection() throws ConnectionException
ConnectionException
public Database getDatabase() throws DBException
DBException
public static ConnectionInfo getConnectionInfo(PropertyStorage ps)
public void onEntry( TraversableContext traversableContext ) { ConnectionInfo connInfo = ConnectionInfo.getConnectionInfo( traversableContext.getPropertyStorage() ); String connName = connInfo.getConnectionName(); ... }
ps
- the PropertyStorage to retrieve/store the connection info in.public static ConnectionInfo getConnectionInfo(PropertyStorage ps, java.lang.String key)
getConnectionInfo(PropertyStorage)
is used.ps
- the PropertyStorage to retrieve/store the connection info in.key
- the key under which to store the connection information.