|
ModeShape Distribution 3.0.0.Beta2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.jcr.value.binary.Database
public class Database

Helper class for manipulation with database.
| Constructor Summary | |
|---|---|
Database(Connection connection)
|
|
| Method Summary | |
|---|---|
static InputStream |
asStream(ResultSet rs)
Provides access to query data |
static String |
asString(ResultSet rs)
Provides access to query data |
protected String |
blobType(Connection connection,
int size)
Determine the database-specific BLOB column type. |
void |
createTable()
Creates table for storage. |
static void |
execute(PreparedStatement sql)
Executes specifies statement. |
static ResultSet |
executeQuery(PreparedStatement sql)
Runs SQL statement |
static void |
executeUpdate(PreparedStatement sql)
Executes specifies update statement. |
PreparedStatement |
insertContentSQL(BinaryKey key,
InputStream stream)
Create statement for store content. |
PreparedStatement |
markUnusedSQL(BinaryKey key)
Generates SQL statement which marks content as not used. |
PreparedStatement |
removeExpiredContentSQL(long deadline)
Generates SQL statement which removes expired content. |
PreparedStatement |
retrieveContentSQL(BinaryKey key)
Generates SQL statement for content retrieve. |
PreparedStatement |
retrieveExtTextSQL(BinaryKey key)
Generate SQL statement which returns extracted text. |
PreparedStatement |
retrieveMimeTypeSQL(BinaryKey key)
Generates SQL statement for mime type retrieve. |
boolean |
tableExists()
Checks database for CONTENT_STORE table |
PreparedStatement |
updateExtTextSQL(BinaryKey key,
String text)
Generates SQL statement which updates extracted text field. |
PreparedStatement |
updateMimeTypeSQL(BinaryKey key,
String mimeType)
Generates SQL statement which modifies mime type value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Database(Connection connection)
| Method Detail |
|---|
public PreparedStatement insertContentSQL(BinaryKey key,
InputStream stream)
throws BinaryStoreException
key - unique content identifierstream - content to store
BinaryStoreException
public PreparedStatement retrieveContentSQL(BinaryKey key)
throws BinaryStoreException
key - content id
BinaryStoreException
public PreparedStatement markUnusedSQL(BinaryKey key)
throws BinaryStoreException
key - the content id.
BinaryStoreException
public PreparedStatement removeExpiredContentSQL(long deadline)
throws BinaryStoreException
deadline - expire time
BinaryStoreException
public PreparedStatement retrieveMimeTypeSQL(BinaryKey key)
throws BinaryStoreException
key - content id
BinaryStoreException
public PreparedStatement updateMimeTypeSQL(BinaryKey key,
String mimeType)
throws BinaryStoreException
key - content idmimeType - the new value for mime type
BinaryStoreException
public PreparedStatement retrieveExtTextSQL(BinaryKey key)
throws BinaryStoreException
key - content id
BinaryStoreException
public PreparedStatement updateExtTextSQL(BinaryKey key,
String text)
throws BinaryStoreException
key - content idtext - new value for the extracted text
BinaryStoreException
public static void execute(PreparedStatement sql)
throws BinaryStoreException
sql - the statement to execute
BinaryStoreException
public static ResultSet executeQuery(PreparedStatement sql)
throws BinaryStoreException
sql - SQL statement
BinaryStoreException
public static void executeUpdate(PreparedStatement sql)
throws BinaryStoreException
sql - the statement to execute
BinaryStoreException
public static InputStream asStream(ResultSet rs)
throws BinaryStoreException
rs - retrieved single value
BinaryStoreException
public static String asString(ResultSet rs)
throws BinaryStoreException
rs - retrieved query result
BinaryStoreException
public boolean tableExists()
throws BinaryStoreException
BinaryStoreException
public void createTable()
throws BinaryStoreException
BinaryStoreException
protected String blobType(Connection connection,
int size)
throws BinaryStoreException
connection - the connectionsize - the size of the column
BinaryStoreException
|
ModeShape Distribution 3.0.0.Beta2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||