Package tigase.util

Class JDBCAbstract


  • @Deprecated
    public abstract class JDBCAbstract
    extends Object
    Deprecated.
    The class has been deprecated in favor of DataRepository class. Please update your code accordingly.

    Created: Mon Mar 3 10:43:44 2008
    Version:
    $Rev$
    Author:
    Artur Hefczyc
    • Constructor Detail

      • JDBCAbstract

        public JDBCAbstract()
        Deprecated.
    • Method Detail

      • initRepository

        public abstract void initRepository​(String conn_str,
                                            Map<String,​String> params)
                                     throws SQLException
        Deprecated.
        initRepository method is doing lazy initialization with database. Connection to database will be established during the first authentication request.
        Parameters:
        conn_str - a String value of database connection string. The string must also contain database user name and password if required for connection.
        params -
        Throws:
        SQLException - if an error occurs during access database. It won't happen however as in this method we do simple variable assigment.
      • getResourceUri

        public String getResourceUri()
        Deprecated.
        getResourceUri method returns database connection string.
        Returns:
        a String value of database connection string.
      • setResourceUri

        public void setResourceUri​(String uri)
        Deprecated.
      • checkConnection

        protected boolean checkConnection()
                                   throws SQLException
        Deprecated.
        checkConnection method checks database connection before any query. For some database servers (or JDBC drivers) it happens the connection is dropped if not in use for a long time or after certain timeout passes. This method allows us to detect the problem and reinitialize database connection.
        Returns:
        a boolean value if the database connection is working.
        Throws:
        SQLException - if an error occurs on database query.
      • initPreparedStatements

        protected void initPreparedStatements()
                                       throws SQLException
        Deprecated.
        initPreparedStatements method initializes internal database connection variables such as prepared statements.
        Throws:
        SQLException - if an error occurs on database query.