Class DatabaseConnection


  • public class DatabaseConnection
    extends UC4Object
    This class represents a CONN.DB Object.
    • Constructor Detail

      • DatabaseConnection

        public DatabaseConnection()
    • 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)
      • 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()
        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​(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 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 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 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 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:"