Class DatabaseUtil


  • @Deprecated
    public class DatabaseUtil
    extends Object
    Deprecated.
    This class is deprecated. Use QueryManagerService instead. This class holds utility methods for database access from the content API services.
    Author:
    ivol
    • Field Detail

      • MEDIAREPOSITORY_DB

        public static final String MEDIAREPOSITORY_DB
        Deprecated.
        Identifier to use for accessing the media repository database
        See Also:
        Constant Field Values
      • TIMESTAMP_DB

        public static final String TIMESTAMP_DB
        Deprecated.
        Identifier to use for accessing the timestamp database
        See Also:
        Constant Field Values
      • WEBADMIN_DB

        public static final String WEBADMIN_DB
        Deprecated.
        Identifier to use for accessing the webadmin database
        See Also:
        Constant Field Values
    • Method Detail

      • setUseFullDbName

        @Deprecated
        public void setUseFullDbName​(boolean useFullFbName)
        Deprecated.
        If this option is set to true, the dbnames that are provided in the execute query methods are assumed to be the full database name which do not have to retrieved from the configuration management service anymore (i.e. myMediaRepositoryDb) If the option is set to false, the dbName represents the name of the dbcpsettings parameter under which the full database name should be retrieved (i.e. mediarepositorydb so that the configuration management is invoked to retrieve the parameter dbcpsettings.mediarepositorydb)
        Parameters:
        useFullFbName -
      • setSPReturnResultAsSingleValue

        @Deprecated
        public void setSPReturnResultAsSingleValue​(boolean returnAsSingleValue)
        Deprecated.
        Defines if the result of calling a stored procedure which returns only one value should be returned as a single value or as an arraylist of arraylists, which is the case when multiple columns or rows are returned. For example; if returnAsSingleValue is set to true and stored procedure returns 'example' this is returned as a String object with the value 'example'. If returnAsSingleValue is set to false it is returned as ArrayList>() with only one row and one column containing a String value 'example'
        Parameters:
        returnAsSingleValue -
      • executeStoredProcedure

        @Deprecated
        public boolean executeStoredProcedure​(String dbName,
                                              String statement,
                                              Object[] arguments)
                                       throws SQLException
        Deprecated.
        This method is deprecated. Use QueryManagerService.executeStoredProcedure instead. Executes a stored procedure on the given database with the given arguments
        Parameters:
        dbName - Name of the database to perform the stored procedure on. Use one of the public static String definitions defined in this class.
        statement - Actual stored procedure to execute
        arguments - Arguments to pass to the stored procedure
        Returns:
        true if the call succeeded, false otherwise
        Throws:
        SQLException
      • callStoredProcedure

        @Deprecated
        public Object callStoredProcedure​(String dbName,
                                          String statement,
                                          Object[] arguments)
                                   throws SQLException
        Deprecated.
        This method is deprecated. Use QueryManagerService.callStoredProcedure instead. Calls a stored procedure (on the given database with the given arguments that returns a result
        Parameters:
        dbName - Name of the database to perform the stored procedure on. Use one of the public static String definitions defined in this class.
        statement - Actual stored procedure to call
        arguments - Arguments to pass to the stored procedure
        Returns:
        Result of the stored procedure represented as Object, null if the call failed
        Throws:
        SQLException
      • executeSelect

        @Deprecated
        public ArrayList<Object> executeSelect​(String dbName,
                                               String statement,
                                               Object[] arguments)
                                        throws SQLException
        Deprecated.
        This method is deprecated. Use QueryManagerService.executeSelect instead. Executes a select query on the given database with the given arguments and returns the single result
        Parameters:
        dbName - Name of the database to perform the query on. Use one of the public static String definitions defined in this class.
        statement - Actual query to execute
        arguments - Arguments to pass to the query
        Returns:
        Result objects from the query
        Throws:
        SQLException
      • executeSelect

        @Deprecated
        public ArrayList<Object> executeSelect​(String dbName,
                                               String statement,
                                               Object[] arguments,
                                               int resultColumnCount)
                                        throws SQLException
        Deprecated.
        This method is deprecated. Use QueryManagerService.executeSelect instead. Executes a select query on the given database with the given arguments and returns the result
        Parameters:
        dbName - Name of the database to perform the query on. Use one of the public static String definitions defined in this class.
        statement - Actual query to execute
        arguments - Arguments to pass to the query
        resultColumnCount - Amount of return values that the query will return
        Returns:
        Result objects from the query
        Throws:
        SQLException
      • executeUpdate

        @Deprecated
        public int executeUpdate​(String dbName,
                                 String statement,
                                 Object[] arguments)
                          throws SQLException
        Deprecated.
        This method is deprecated. Use QueryManagerService.executeUpdate instead. Executes an update query on the given database with the given arguments and returns the result
        Parameters:
        dbName - Name of the database to perform the query on. Use one of the public static String definitions defined in this class.
        statement - Actual query to execute
        arguments - Arguments to pass to the query
        Returns:
        Result objects from the query
        Throws:
        SQLException
      • close

        @Deprecated
        public void close​(Statement statement,
                          Connection con)
                   throws SQLException
        Deprecated.
        This class is deprecated. Use QueryManagerService instead. Utility method to close a statement and a connection safely.
        Parameters:
        statement -
        con -
        Throws:
        SQLException
      • close

        @Deprecated
        public void close​(ResultSet rs,
                          Connection con)
                   throws SQLException
        Deprecated.
        This class is deprecated. Use QueryManagerService instead. Utility method to close a resultset and a connection safely.
        Parameters:
        rs -
        con -
        Throws:
        SQLException
      • getAsInt

        @Deprecated
        public static int getAsInt​(Object object)
        Deprecated.
        This class is deprecated. Use QueryManagerService instead. Returns an object that was returned as result of a query as an Integer. This is necessary for the generic executeSelect since a getObject on a number result in oracle does not return an Integer but a BigDecimal
        Parameters:
        object - Object of the result query to be converted to an Integer
        Returns:
        Value of the object as Integer