On 03/09/13 19:35, Márcio Vinicius wrote:
Dear, I have studied the Jena for some time and did some test prototypes.
In recent studies found that the documentation indicates the TDB component
for development of new applications, but all prototypes that had made was
based on SDB.

Example of connection:

       public Store getStore() {

StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
  DatabaseType.PostgreSQL);
JDBC.loadDriverPGSQL();

SDBConnection conn = new SDBConnection(Constants.DB_URL,
  Constants.DB_USER,
Constants.DB_PASSWD);

Store store = SDBFactory.connectStore(conn, storeDesc);
  try {
if (!StoreUtils.isFormatted(store)) {
store.getTableFormatter().create();
  }
} catch (SQLException e) {
e.printStackTrace();
  }
return store;
}

How do I use the component TDB?

Hi there,

See

http://jena.apache.org/documentation/tdb/

The pattern is similar:

Dataset ds = TDBFactory.createDatatset(directory) ;

and use the dataset as normal.

No formatting is necessary.

        Andy


att


Reply via email to