@Deprecated public abstract class JDBCAbstract extends Object
DataRepository
class. Please update your code accordingly.
Modifier and Type | Field and Description |
---|---|
static String |
DERBY_CONNVALID_QUERY
Deprecated.
|
static String |
JDBC_CONNVALID_QUERY
Deprecated.
|
static String |
SP_STARTS_WITH
Deprecated.
|
Constructor and Description |
---|
JDBCAbstract()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkConnection()
Deprecated.
checkConnection method checks database connection before any query. |
String |
getResourceUri()
Deprecated.
getResourceUri method returns database connection string. |
protected void |
initPreparedStatements()
Deprecated.
initPreparedStatements method initializes internal database connection variables such as prepared
statements. |
abstract void |
initRepository(String conn_str,
Map<String,String> params)
Deprecated.
initRepository method is doing lazy initialization with database. |
CallableStatement |
prepareCallable(String query)
Deprecated.
|
PreparedStatement |
prepareQuery(String query)
Deprecated.
|
PreparedStatement |
prepareStatement(String query)
Deprecated.
|
protected void |
release(Statement stmt,
ResultSet rs)
Deprecated.
|
void |
setResourceUri(String uri)
Deprecated.
|
public static final String SP_STARTS_WITH
public static final String DERBY_CONNVALID_QUERY
public static final String JDBC_CONNVALID_QUERY
public abstract void initRepository(String conn_str, Map<String,String> params) throws SQLException
initRepository
method is doing lazy initialization with database. Connection to database will be
established during the first authentication request.conn_str
- a String
value of database connection string. The string must also contain database
user name and password if required for connection.params
- SQLException
- if an error occurs during access database. It won't happen however as in this method we do
simple variable assigment.public String getResourceUri()
getResourceUri
method returns database connection string.String
value of database connection string.public void setResourceUri(String uri)
public CallableStatement prepareCallable(String query) throws SQLException
SQLException
public PreparedStatement prepareQuery(String query) throws SQLException
SQLException
public PreparedStatement prepareStatement(String query) throws SQLException
SQLException
protected boolean checkConnection() throws SQLException
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.boolean
value if the database connection is working.SQLException
- if an error occurs on database query.protected void initPreparedStatements() throws SQLException
initPreparedStatements
method initializes internal database connection variables such as prepared
statements.SQLException
- if an error occurs on database query.Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.