Package com.uc4.api.objects
Class DatabaseConnection
- java.lang.Object
-
- com.uc4.api.objects.UC4Object
-
- com.uc4.api.objects.DatabaseConnection
-
public class DatabaseConnection extends UC4Object
This class represents a CONN.DB Object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DatabaseConnection.DatabaseType
Type of the database.
-
Constructor Summary
Constructors Constructor Description DatabaseConnection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
Returnstrue
if this Object can be executed.boolean
isOracleServiceName()
Returnstrue
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)
-
-
-
Method Detail
-
header
public Header header()
Returns the header data of this object. This is the information of the header tab in the dialog client.- Returns:
- header
-
loadContent
protected void loadContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
-
storeContent
protected void storeContent(com.uc4.util.XMLDocument doc, org.w3c.dom.Element objectElement, ConnectionAttributes sessionInfo)
-
getDBType
public DatabaseConnection.DatabaseType getDBType()
Returns the database type.- Returns:
- Vendor of the database
-
setDBType
public void setDBType(DatabaseConnection.DatabaseType type)
Sets the database type.- Parameters:
type
- Vendor of the database
-
getDbPort
public int getDbPort()
- Returns:
- Port of the Database
-
setDbPort
public void setDbPort(int dbPort)
Sets the port of the database.- Parameters:
dbPort
- Port
-
getDbName
public java.lang.String getDbName()
Returns the name of the database.- Returns:
- DB name
-
setDbName
public void setDbName(java.lang.String dbName)
Sets the name of the database.- Parameters:
dbName
- DB name
-
getDbServer
public java.lang.String getDbServer()
Returns the host name of the database server.- Returns:
- DB Server
-
isOracleServiceName
public boolean isOracleServiceName()
Returnstrue
if the DB name is the service name of an Oracle database.- Returns:
- True for Oracle Service name, false if DB name is the SID
-
setOracleServiceName
public void setOracleServiceName(boolean oracleServiceName)
Defines how the database name is used in case of Oracle. The value is ignored for other database types.- Parameters:
oracleServiceName
- true if the DB name is a service name or false for SID
-
setDbServer
public void setDbServer(java.lang.String serverName)
Sets the database server name.- Parameters:
serverName
- Host of the database server
-
getConnectStringValues
public java.util.Map<java.lang.String,java.lang.String> getConnectStringValues()
Returns an unmodifiable map which contains all connect string values.- Returns:
- Connect String values
-
getConnectProperties
public java.util.Map<java.lang.String,java.lang.String> getConnectProperties()
Returns an unmodifiable map which contains all connect properties.- Returns:
- Connect properties
-
clearConnectStringValues
public void clearConnectStringValues()
Clears the table of the connect string values.
-
clearConnectProperties
public void clearConnectProperties()
Clears the table of connect properties.
-
addConnectString
public void addConnectString(java.lang.String name, java.lang.String value)
Adds a value for the connect String at the end of the table.- Parameters:
name
- Name of the propertyvalue
- Value
-
getAlternativeLogin
public UC4ObjectName getAlternativeLogin()
- Returns:
- Name of the alternative Login Object
-
setAlternativeLogin
public void setAlternativeLogin(UC4ObjectName alternativeLogin)
Sets an alternative Login Object.- Parameters:
alternativeLogin
- Alternative Login
-
getUser
public java.lang.String getUser()
- Returns:
- Name of the Database user
-
setUser
public void setUser(java.lang.String user)
- Parameters:
user
- Sets the name of the user
-
setPassword
public void setPassword(java.lang.String password)
Sets the password of the database user.- Parameters:
password
- Password of the User
-
addConnectProperties
public void addConnectProperties(java.lang.String name, java.lang.String value)
Adds a value for the connect properties at the end of the table.- Parameters:
name
- Name of the propertyvalue
- Value
-
isExecutable
public boolean isExecutable()
Description copied from class:UC4Object
Returnstrue
if this Object can be executed.- Specified by:
isExecutable
in classUC4Object
- Returns:
- true if the Object can be executed, false if not.
-
getGenericJdbcConnectString
public java.lang.String getGenericJdbcConnectString()
Returns the JDBC connect string if "Generic JDBC" is selected as database type.- Returns:
- Connect String or an empty String if not set. The return value is never null.
-
setGenericJdbcConnectString
public void setGenericJdbcConnectString(java.lang.String connect)
Sets the JDBC connect String. This value is only used if the type is "Generic JDBC".- Parameters:
connect
- Connect String which starts with "jdbc:"
-
-