|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDBConnection
Encapsulate the specification of a jdbc connection, mostly used to simplify the calling pattern for ModelRDB factory methods.
Method Summary | |
---|---|
void |
cleanDB()
Clear all RDF information from the database. |
void |
close()
Close the jdbc connection |
boolean |
containsDefaultModel()
Test if a default model is contained in the database. |
boolean |
containsModel(String name)
Test if a given model is contained in the database. |
ExtendedIterator |
getAllModelNames()
Retrieve a list of all models in the database |
Connection |
getConnection()
Return the jdbc connection or null if we no longer have access to a connection. |
Model |
getDatabaseProperties()
Returns a Jena Model containing database properties. |
String |
getDatabaseType()
Get the database type. |
Model |
getDefaultModelProperties()
Retrieve a default set of model customization properties. |
com.hp.hpl.jena.db.impl.IRDBDriver |
getDriver()
Get the database-specific driver For this to work, it needs to know the type of database being used. |
com.hp.hpl.jena.db.impl.IRDBDriver |
getDriver(String layout,
String database)
Deprecated. As of Jena 2.0 this call should not be used. Instead specify the database type when constructing a DBConnection and then pass that connection to the GraphRDB. There is no longer any need for applications to interact with the IRDBDriver. To customize the database configuration/layout use the formatDB(propertyModel) call. |
boolean |
isFormatOK()
Return true if the database seems to be formated for RDF storage. |
void |
setDatabaseProperties(Model propertyModel)
Sets database-specific properties. |
void |
setDatabaseType(String databaseType)
Set the database type manually. |
void |
setDriver(com.hp.hpl.jena.db.impl.IRDBDriver driver)
Set the IRDBDriver to use for this connection. |
Method Detail |
---|
Connection getConnection() throws SQLException
SQLException
void close() throws SQLException
SQLException
void cleanDB() throws SQLException
SQLException
boolean isFormatOK() throws RDFRDBException
RDFRDBException
void setDatabaseProperties(Model propertyModel) throws RDFRDBException
These properties may only be set before the first Model has been stored in the database. After that point, the database structure is frozen.
Use these properties to optionally customize the database - this won't change the results you see when using the graph interface, but it may alter the speed with which you get them or the space required by the database.
The properties must form a complete and consistent set. The easist way to get a complete and consistent set is to call getDatabaseProperties, modify the returned model, and then use that as an argument in the call to setDatabaseProperties.
Note that some implementations may choose to delay actually peforming the formatting operation until at least one Graph is constructed in the database. Consequently, a successful return from this call does not necessarily guarantee that the database properties were set correctly.
propertyModel
- is a Model describing the database parameters
RDFRDBException
Model getDatabaseProperties() throws RDFRDBException
These describe the optimization/layout for the database.
If the database has not been formatted, then a default set of properties is returned. Otherwise the actual properties are returned.
The returned Model is a copy, modifying it will have no effect on the database. (Use setDatabaseProperties to make changes).
RDFRDBException
void setDatabaseType(String databaseType)
This is not for public use (it is preferable to specify it in the constructor) - included here to handle older code, which didn't use the new constructor.
Model getDefaultModelProperties() throws RDFRDBException
RDFRDBException
String getDatabaseType()
ExtendedIterator getAllModelNames() throws RDFRDBException
RDFDBException
RDFRDBException
boolean containsModel(String name) throws RDFRDBException
name
- the name of a model which may be in the database
RDFDBException
RDFRDBException
boolean containsDefaultModel() throws RDFRDBException
RDFDBException
RDFRDBException
com.hp.hpl.jena.db.impl.IRDBDriver getDriver() throws RDFRDBException
RDFRDBException
void setDriver(com.hp.hpl.jena.db.impl.IRDBDriver driver)
com.hp.hpl.jena.db.impl.IRDBDriver getDriver(String layout, String database) throws RDFRDBException
RDFRDBException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |