|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex
public class DbNameIndex
Implements a StringIndex
that stores and retrieves the names from a
table in a database.
Field Summary | |
---|---|
protected ConnectionRecoveryManager |
connectionManager
The class that manages statement execution and recovery from connection loss. |
protected String |
indexSelectSQL
|
protected String |
nameInsertSQL
|
protected String |
nameSelectSQL
|
Constructor Summary | |
---|---|
DbNameIndex(ConnectionRecoveryManager conMgr,
String schemaObjectPrefix)
Creates a new index that is stored in a db. |
Method Summary | |
---|---|
void |
close()
Closes this index and releases it's resources. |
protected void |
closeResultSet(ResultSet rs)
Closes the result set |
protected int |
getIndex(String string)
Retrieves the index from the database for the given string. |
protected String |
getString(int index)
Retrieves the string from the database for the given index. |
String |
indexToString(int idx)
Returns the string for a given index. |
protected void |
init(String schemaObjectPrefix)
Inits this index and prepares the statements. |
protected int |
insertString(String string)
Inserts a string into the database and returns the new index. |
int |
stringToIndex(String string)
Returns the index for a given string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConnectionRecoveryManager connectionManager
protected String nameSelectSQL
protected String indexSelectSQL
protected String nameInsertSQL
Constructor Detail |
---|
public DbNameIndex(ConnectionRecoveryManager conMgr, String schemaObjectPrefix) throws SQLException
con
- the jdbc connectionschemaObjectPrefix
- the prefix for table names
SQLException
- if the statements cannot be prepared.Method Detail |
---|
protected void init(String schemaObjectPrefix) throws SQLException
con
- the jdbc connectionschemaObjectPrefix
- the prefix for table names
SQLException
- if the statements cannot be prepared.public void close()
public int stringToIndex(String string)
stringToIndex
in interface StringIndex
string
- the string to return the index for
public String indexToString(int idx)
null
is returned.
indexToString
in interface StringIndex
idx
- the index tp returns the string for.
null
protected int insertString(String string)
string
- the string to insert
protected int getIndex(String string)
string
- the string to retrieve the index for
protected String getString(int index)
index
- the index to retrieve the string for.
null
if not found.protected void closeResultSet(ResultSet rs)
rs
- the result set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |