Class JdbcActions

    • Constructor Detail

      • JdbcActions

        @FeatureToggle(featureID="CM-0008.CO02")
        public JdbcActions​(boolean activateTestMode)
        Constructor.
        Parameters:
        activateTestMode - as boolean
    • Method Detail

      • connect

        public boolean connect​(String propertyFile)
        Description copied from interface: DatabaseActions
        Establish an JDBC Connection. If the propertyFile Parameter is empty, then the Method load by default the configuration from the classpath. The path to the external property file have to be relative to the execution path.
        Specified by:
        connect in interface DatabaseActions
        Parameters:
        propertyFile - as String
        Returns:
        true on success
      • executeSqlFromClasspath

        public boolean executeSqlFromClasspath​(String sqlFile)
        Description copied from interface: DatabaseActions
        Load an SQL File from the classpath and execute the script. Attention: This function should be used to populate a database and so on. It is not designed to handle multiple ResultSets by using SELECT. If multiple SELECT statements appears in an SQL File, then only the ResultSet of the last SELECT statement will be available.
        Internal call this function for each single SQL statement the executeQuery() method.
        Specified by:
        executeSqlFromClasspath in interface DatabaseActions
        Parameters:
        sqlFile - as String
        Returns:
        true on success
      • executeQuery

        public boolean executeQuery​(String sql)
        Description copied from interface: DatabaseActions
        Execute a plain SQL Query.
        Specified by:
        executeQuery in interface DatabaseActions
        Parameters:
        sql - as String
        Returns:
        true on success
      • getResultSet

        public ResultSet getResultSet()
        Description copied from interface: DatabaseActions
        Get the ResultSet from an SQL Query. RestultSet get produced by executeQuery(). If exist in an SQL File multiple SELECT statements, then the ResultSet contains only the rusultSet of the last SELECT statement.
        Specified by:
        getResultSet in interface DatabaseActions
        Returns:
        results as ResultSet
      • getPort

        public int getPort()
        Description copied from interface: DatabaseActions
        Get the port for the configured database connection.
        Specified by:
        getPort in interface DatabaseActions
        Returns:
        port as int
      • getUri

        public String getUri()
        Description copied from interface: DatabaseActions
        Get the host URL / IP of the configured Database connection.
        Specified by:
        getUri in interface DatabaseActions
        Returns:
        uri as String