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.
  • Constructor Details

    • DatabaseConnection

      public DatabaseConnection()
  • Method Details

    • 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, 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 String getDbName()
      Returns the name of the database.
      Returns:
      DB name
    • setDbName

      public void setDbName(String dbName)
      Sets the name of the database.
      Parameters:
      dbName - DB name
    • getDbServer

      public String getDbServer()
      Returns the host name of the database server.
      Returns:
      DB Server
    • isOracleServiceName

      public boolean isOracleServiceName()
      Returns true 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(String serverName)
      Sets the database server name.
      Parameters:
      serverName - Host of the database server
    • getConnectStringValues

      public Map<String,String> getConnectStringValues()
      Returns an unmodifiable map which contains all connect string values.
      Returns:
      Connect String values
    • getConnectProperties

      public Map<String,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(String name, String value)
      Adds a value for the connect String at the end of the table.
      Parameters:
      name - Name of the property
      value - 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 String getUser()
      Returns:
      Name of the Database user
    • setUser

      public void setUser(String user)
      Parameters:
      user - Sets the name of the user
    • setPassword

      public void setPassword(String password)
      Sets the password of the database user.
      Parameters:
      password - Password of the User
    • addConnectProperties

      public void addConnectProperties(String name, String value)
      Adds a value for the connect properties at the end of the table.
      Parameters:
      name - Name of the property
      value - Value
    • isExecutable

      public boolean isExecutable()
      Description copied from class: UC4Object
      Returns true if this Object can be executed.
      Specified by:
      isExecutable in class UC4Object
      Returns:
      true if the Object can be executed, false if not.
    • getGenericJdbcConnectString

      public 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(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:"