|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.mesa.rdf.jena.rdb.DBConnection
Encapsulate the specification of a jdbc connection, mostly used to simplify the calling pattern for ModelRDB factory methods.
Fields inherited from interface com.hp.hpl.mesa.rdf.jena.rdb.IDBConnection |
DATABASE_TYPE, DRIVER_CLASSNAME, LAYOUT_TYPE |
Constructor Summary | |
DBConnection(java.sql.Connection connection)
Create a connection specification that just wraps up an existing database connection. |
|
DBConnection(java.lang.String url,
java.lang.String user,
java.lang.String password)
Create a connection specification based on jdbc address and appropriate authentication information. |
Method Summary | |
void |
addProperty(java.lang.String propname,
java.lang.String value)
Add a new property value to both RDF_LAYOUT_INFO table. |
void |
close()
Close the jdbc connection. |
java.sql.Connection |
getConnection()
Return the jdbc connection or null if we no longer have access to a connection. |
IRDBDriver |
getDriver()
Return an IRDBDriver suitable for this database connection. |
IRDBDriver |
getDriver(java.lang.String layout,
java.lang.String database)
Helper function to locate and instantiate the driver class corresponding to a given layout and database name Throws an RDFRDBexception if the driver can't be instantiated |
java.util.Properties |
getProperties()
Returns a set of property values for the database at the end of the connection. |
java.lang.String |
getProperty(java.lang.String propname)
Returns a property value for the database at the end of the connection. |
boolean |
isFormatOK()
Return true if the database seems to be formated for RDF storage. |
void |
setDriver(IRDBDriver driver)
Set the IRDBDriver to use for this connection. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DBConnection(java.lang.String url, java.lang.String user, java.lang.String password)
url
- the jdbc url for the database, note that the format of this
is database dependent and that the appropriate jdbc driver will need to
be specified either in the jdbc.drivers property or via the standard pattern
Class.forName("my.sql.driver");
user
- the user name to log on withpassword
- the password corresponding to this userpublic DBConnection(java.sql.Connection connection)
connection
- the open jdbc connection to useMethod Detail |
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface IDBConnection
public void close() throws java.sql.SQLException
close
in interface IDBConnection
public boolean isFormatOK() throws RDFRDBException
isFormatOK
in interface IDBConnection
public java.lang.String getProperty(java.lang.String propname) throws java.sql.SQLException
getProperty
in interface IDBConnection
public java.util.Properties getProperties() throws java.sql.SQLException
getProperties
in interface IDBConnection
public IRDBDriver getDriver() throws RDFRDBException
getDriver
in interface IDBConnection
public void setDriver(IRDBDriver driver)
setDriver
in interface IDBConnection
public IRDBDriver getDriver(java.lang.String layout, java.lang.String database) throws RDFRDBException
getDriver
in interface IDBConnection
public void addProperty(java.lang.String propname, java.lang.String value) throws java.sql.SQLException
addProperty
in interface IDBConnection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |