use of org.apache.jena.sdb.Store in project jena by apache.
the class ExJdbcConnection method query.
public static void query(String queryString, StoreDesc storeDesc, Connection jdbcConnection) {
Query query = QueryFactory.create(queryString);
SDBConnection conn = new SDBConnection(jdbcConnection);
Store store = StoreFactory.create(storeDesc, conn);
Dataset ds = DatasetStore.create(store);
QueryExecution qe = QueryExecutionFactory.create(query, ds);
try {
ResultSet rs = qe.execSelect();
ResultSetFormatter.out(rs);
} finally {
qe.close();
}
// Does not close the JDBC connection.
// Do not call : store.getConnection().close() , which does close the underlying connection.
store.close();
}
use of org.apache.jena.sdb.Store in project jena by apache.
the class SDBTestUtils method createInMemoryStore.
/** Create an HSQLDB-backed in-memory store for testing. */
public static Store createInMemoryStore() {
SDBConnection conn = SDBFactory.createConnection("jdbc:hsqldb:mem:test", "sa", "");
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesHash, DatabaseType.HSQLDB);
Store store = SDBFactory.connectStore(conn, desc);
store.getTableFormatter().create();
store.getTableFormatter().truncate();
return store;
}
use of org.apache.jena.sdb.Store in project jena by apache.
the class TestAssembler method store_1.
@Test
public void store_1() {
Store store = SDBFactory.connectStore(dir + "store.ttl");
assertNotNull(store);
}
use of org.apache.jena.sdb.Store in project jena by apache.
the class TestAssembler method pool_1.
@Test
public void pool_1() {
// Connection
Connection conn = SDBFactory.createSqlConnection(dir + "connection.ttl");
// Store
StoreDesc desc = StoreDesc.read(dir + "dataset2.ttl");
Store store = SDBFactory.connectStore(conn, desc);
}
use of org.apache.jena.sdb.Store in project jena by apache.
the class TestAssembler method model_3.
@Test
public void model_3() {
Model assem = FileManager.get().loadModel(dir + "graph-assembler.ttl");
Resource xDft = assem.getResource("http://example/test#graphDft");
Resource xNamed = assem.getResource("http://example/test#graphNamed");
Store store = create(assem);
Model model1 = (Model) Assembler.general.open(xDft);
Model model2 = (Model) Assembler.general.open(xNamed);
assertNotNull(model1 != model2);
}
Aggregations