public class DatabaseConnection extends UC4Object
Modifier and Type | Class and Description |
---|---|
static class |
DatabaseConnection.DatabaseType
Type of the database.
|
Constructor and Description |
---|
DatabaseConnection() |
Modifier and Type | Method and Description |
---|---|
void |
addConnectProperties(java.lang.String name,
java.lang.String value)
Adds a value for the connect properties at the end of the table.
|
void |
addConnectString(java.lang.String name,
java.lang.String value)
Adds a value for the connect String at the end of the table.
|
void |
clearConnectProperties()
Clears the table of connect properties.
|
void |
clearConnectStringValues()
Clears the table of the connect string values.
|
UC4ObjectName |
getAlternativeLogin() |
java.util.Map<java.lang.String,java.lang.String> |
getConnectProperties()
Returns an unmodifiable map which contains all connect properties.
|
java.util.Map<java.lang.String,java.lang.String> |
getConnectStringValues()
Returns an unmodifiable map which contains all connect string values.
|
java.lang.String |
getDbName()
Returns the name of the database.
|
int |
getDbPort() |
java.lang.String |
getDbServer()
Returns the host name of the database server.
|
DatabaseConnection.DatabaseType |
getDBType()
Returns the database type.
|
java.lang.String |
getGenericJdbcConnectString()
Returns the JDBC connect string if "Generic JDBC" is selected as database type.
|
java.lang.String |
getUser() |
Header |
header()
Returns the header data of this object.
|
boolean |
isExecutable()
Returns
true if this Object can be executed. |
boolean |
isOracleServiceName()
Returns
true if the DB name is the service name of an Oracle database. |
protected void |
loadContent(com.uc4.util.XMLDocument doc,
ConnectionAttributes session) |
void |
setAlternativeLogin(UC4ObjectName alternativeLogin)
Sets an alternative Login Object.
|
void |
setDbName(java.lang.String dbName)
Sets the name of the database.
|
void |
setDbPort(int dbPort)
Sets the port of the database.
|
void |
setDbServer(java.lang.String serverName)
Sets the database server name.
|
void |
setDBType(DatabaseConnection.DatabaseType type)
Sets the database type.
|
void |
setGenericJdbcConnectString(java.lang.String connect)
Sets the JDBC connect String.
|
void |
setOracleServiceName(boolean oracleServiceName)
Defines how the database name is used in case of Oracle.
|
void |
setPassword(java.lang.String password)
Sets the password of the database user.
|
void |
setUser(java.lang.String user) |
protected void |
storeContent(com.uc4.util.XMLDocument doc,
org.w3c.dom.Element objectElement,
ConnectionAttributes sessionInfo)
Stores the object specific data under the
objectElement element. |
public Header header()
protected void loadContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
protected void storeContent(com.uc4.util.XMLDocument doc, org.w3c.dom.Element objectElement, ConnectionAttributes sessionInfo)
UC4Object
objectElement
element.doc
- XML Document, used to create subelementsobjectElement
- the newly created elements are children of the objectElement
elementsessionInfo
- Information about the current sessionpublic DatabaseConnection.DatabaseType getDBType()
public void setDBType(DatabaseConnection.DatabaseType type)
type
- Vendor of the databasepublic int getDbPort()
public void setDbPort(int dbPort)
dbPort
- Portpublic java.lang.String getDbName()
public void setDbName(java.lang.String dbName)
dbName
- DB namepublic java.lang.String getDbServer()
public boolean isOracleServiceName()
true
if the DB name is the service name of an Oracle database.public void setOracleServiceName(boolean oracleServiceName)
oracleServiceName
- true if the DB name is a service name or false for SIDpublic void setDbServer(java.lang.String serverName)
serverName
- Host of the database serverpublic java.util.Map<java.lang.String,java.lang.String> getConnectStringValues()
public java.util.Map<java.lang.String,java.lang.String> getConnectProperties()
public void clearConnectStringValues()
public void clearConnectProperties()
public void addConnectString(java.lang.String name, java.lang.String value)
name
- Name of the propertyvalue
- Valuepublic UC4ObjectName getAlternativeLogin()
public void setAlternativeLogin(UC4ObjectName alternativeLogin)
alternativeLogin
- Alternative Loginpublic java.lang.String getUser()
public void setUser(java.lang.String user)
user
- Sets the name of the userpublic void setPassword(java.lang.String password)
password
- Password of the Userpublic void addConnectProperties(java.lang.String name, java.lang.String value)
name
- Name of the propertyvalue
- Valuepublic boolean isExecutable()
UC4Object
true
if this Object can be executed.isExecutable
in class UC4Object
public java.lang.String getGenericJdbcConnectString()
public void setGenericJdbcConnectString(java.lang.String connect)
connect
- Connect String which starts with "jdbc:"