|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttigase.util.JDBCAbstract
public abstract class JDBCAbstract
Describe class JDBCAbstract here. Created: Mon Mar 3 10:43:44 2008
Field Summary | |
---|---|
static java.lang.String |
DERBY_CONNVALID_QUERY
Field description |
static java.lang.String |
JDBC_CONNVALID_QUERY
Field description |
static java.lang.String |
SP_STARTS_WITH
Field description |
Constructor Summary | |
---|---|
JDBCAbstract()
|
Method Summary | |
---|---|
protected boolean |
checkConnection()
checkConnection method checks database connection before any
query. |
java.lang.String |
getResourceUri()
getResourceUri method returns database connection string. |
protected void |
initPreparedStatements()
initPreparedStatements method initializes internal
database connection variables such as prepared statements. |
abstract void |
initRepository(java.lang.String conn_str,
java.util.Map<java.lang.String,java.lang.String> params)
initRepository method is doing lazy initialization with database. |
java.sql.CallableStatement |
prepareCallable(java.lang.String query)
Method description |
java.sql.PreparedStatement |
prepareQuery(java.lang.String query)
Method description |
java.sql.PreparedStatement |
prepareStatement(java.lang.String query)
Method description |
protected void |
release(java.sql.Statement stmt,
java.sql.ResultSet rs)
|
void |
setResourceUri(java.lang.String uri)
Method description |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SP_STARTS_WITH
public static final java.lang.String DERBY_CONNVALID_QUERY
public static final java.lang.String JDBC_CONNVALID_QUERY
Constructor Detail |
---|
public JDBCAbstract()
Method Detail |
---|
public abstract void initRepository(java.lang.String conn_str, java.util.Map<java.lang.String,java.lang.String> params) throws java.sql.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
-
java.sql.SQLException
- if an error occurs during access database. It won't
happen however as in this method we do simple variable assigment.public java.lang.String getResourceUri()
getResourceUri
method returns database connection string.
String
value of database connection string.public java.sql.CallableStatement prepareCallable(java.lang.String query) throws java.sql.SQLException
query
-
java.sql.SQLException
public java.sql.PreparedStatement prepareQuery(java.lang.String query) throws java.sql.SQLException
query
-
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String query) throws java.sql.SQLException
query
-
java.sql.SQLException
public void setResourceUri(java.lang.String uri)
uri
- protected boolean checkConnection() throws java.sql.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.
java.sql.SQLException
- if an error occurs on database query.protected void initPreparedStatements() throws java.sql.SQLException
initPreparedStatements
method initializes internal
database connection variables such as prepared statements.
java.sql.SQLException
- if an error occurs on database query.protected void release(java.sql.Statement stmt, java.sql.ResultSet rs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |