Package com.uc4.api.objects
Class DatabaseConnection
java.lang.Object
com.uc4.api.objects.UC4Object
com.uc4.api.objects.DatabaseConnection
This class represents a CONN.DB Object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of the database. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectProperties(String name, String value) Adds a value for the connect properties at the end of the table.voidaddConnectString(String name, String value) Adds a value for the connect String at the end of the table.voidClears the table of connect properties.voidClears the table of the connect string values.Returns an unmodifiable map which contains all connect properties.Returns an unmodifiable map which contains all connect string values.Returns the name of the database.intReturns the host name of the database server.Returns the database type.Returns the JDBC connect string if "Generic JDBC" is selected as database type.getUser()header()Returns the header data of this object.booleanReturnstrueif this Object can be executed.booleanReturnstrueif the DB name is the service name of an Oracle database.protected voidloadContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session) voidsetAlternativeLogin(UC4ObjectName alternativeLogin) Sets an alternative Login Object.voidSets the name of the database.voidsetDbPort(int dbPort) Sets the port of the database.voidsetDbServer(String serverName) Sets the database server name.voidSets the database type.voidsetGenericJdbcConnectString(String connect) Sets the JDBC connect String.voidsetOracleServiceName(boolean oracleServiceName) Defines how the database name is used in case of Oracle.voidsetPassword(String password) Sets the password of the database user.voidprotected voidstoreContent(com.uc4.util.XMLDocument doc, Element objectElement, ConnectionAttributes sessionInfo) Methods inherited from class com.uc4.api.objects.UC4Object
docu, getAccess, getIdnr, getModCount, getName, getObjectClient, getType, isOldVersion, load, store, validate
-
Constructor Details
-
DatabaseConnection
public DatabaseConnection()
-
-
Method Details
-
header
Returns the header data of this object. This is the information of the header tab in the dialog client.- Returns:
- header
-
loadContent
-
storeContent
protected void storeContent(com.uc4.util.XMLDocument doc, Element objectElement, ConnectionAttributes sessionInfo) -
getDBType
Returns the database type.- Returns:
- Vendor of the database
-
setDBType
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
Returns the name of the database.- Returns:
- DB name
-
setDbName
Sets the name of the database.- Parameters:
dbName- DB name
-
getDbServer
Returns the host name of the database server.- Returns:
- DB Server
-
isOracleServiceName
public boolean isOracleServiceName()Returnstrueif 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
Sets the database server name.- Parameters:
serverName- Host of the database server
-
getConnectStringValues
Returns an unmodifiable map which contains all connect string values.- Returns:
- Connect String values
-
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
Adds a value for the connect String at the end of the table.- Parameters:
name- Name of the propertyvalue- Value
-
getAlternativeLogin
- Returns:
- Name of the alternative Login Object
-
setAlternativeLogin
Sets an alternative Login Object.- Parameters:
alternativeLogin- Alternative Login
-
getUser
- Returns:
- Name of the Database user
-
setUser
- Parameters:
user- Sets the name of the user
-
setPassword
Sets the password of the database user.- Parameters:
password- Password of the User
-
addConnectProperties
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:UC4ObjectReturnstrueif this Object can be executed.- Specified by:
isExecutablein classUC4Object- Returns:
- true if the Object can be executed, false if not.
-
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
Sets the JDBC connect String. This value is only used if the type is "Generic JDBC".- Parameters:
connect- Connect String which starts with "jdbc:"
-