Package tigase.util
Class JDBCAbstract
- java.lang.Object
-
- tigase.util.JDBCAbstract
-
@Deprecated public abstract class JDBCAbstract extends Object
Deprecated.The class has been deprecated in favor ofDataRepositoryclass. Please update your code accordingly.
Created: Mon Mar 3 10:43:44 2008- Version:
- $Rev$
- Author:
- Artur Hefczyc
-
-
Field Summary
Fields Modifier and Type Field Description static StringDERBY_CONNVALID_QUERYDeprecated.static StringJDBC_CONNVALID_QUERYDeprecated.static StringSP_STARTS_WITHDeprecated.
-
Constructor Summary
Constructors Constructor Description JDBCAbstract()Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleancheckConnection()Deprecated.checkConnectionmethod checks database connection before any query.StringgetResourceUri()Deprecated.getResourceUrimethod returns database connection string.protected voidinitPreparedStatements()Deprecated.initPreparedStatementsmethod initializes internal database connection variables such as prepared statements.abstract voidinitRepository(String conn_str, Map<String,String> params)Deprecated.initRepositorymethod is doing lazy initialization with database.CallableStatementprepareCallable(String query)Deprecated.PreparedStatementprepareQuery(String query)Deprecated.PreparedStatementprepareStatement(String query)Deprecated.protected voidrelease(Statement stmt, ResultSet rs)Deprecated.voidsetResourceUri(String uri)Deprecated.
-
-
-
Field Detail
-
SP_STARTS_WITH
public static final String SP_STARTS_WITH
Deprecated.- See Also:
- Constant Field Values
-
DERBY_CONNVALID_QUERY
public static final String DERBY_CONNVALID_QUERY
Deprecated.- See Also:
- Constant Field Values
-
JDBC_CONNVALID_QUERY
public static final String JDBC_CONNVALID_QUERY
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
initRepository
public abstract void initRepository(String conn_str, Map<String,String> params) throws SQLException
Deprecated.initRepositorymethod is doing lazy initialization with database. Connection to database will be established during the first authentication request.- Parameters:
conn_str- aStringvalue 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.getResourceUrimethod returns database connection string.- Returns:
- a
Stringvalue of database connection string.
-
setResourceUri
public void setResourceUri(String uri)
Deprecated.
-
prepareCallable
public CallableStatement prepareCallable(String query) throws SQLException
Deprecated.- Throws:
SQLException
-
prepareQuery
public PreparedStatement prepareQuery(String query) throws SQLException
Deprecated.- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String query) throws SQLException
Deprecated.- Throws:
SQLException
-
checkConnection
protected boolean checkConnection() throws SQLExceptionDeprecated.checkConnectionmethod 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
booleanvalue if the database connection is working. - Throws:
SQLException- if an error occurs on database query.
-
initPreparedStatements
protected void initPreparedStatements() throws SQLExceptionDeprecated.initPreparedStatementsmethod initializes internal database connection variables such as prepared statements.- Throws:
SQLException- if an error occurs on database query.
-
-