use of org.apache.jena.sdb.sql.SDBConnection in project jena by apache.
the class StoreCreator method getIndexDB2.
public static Store getIndexDB2() {
if (sdbdb2i == null) {
JDBC.loadDriverDB2();
String url = JDBC.makeURL("db2", "sweb-sdb-4:50000", "TEST2I");
SDBConnection sdb = new SDBConnection(url, "user", "password");
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesIndex, DatabaseType.DB2);
sdbdb2i = new StoreTriplesNodesIndexDB2(sdb, desc);
sdbdb2i.getTableFormatter().create();
}
sdbdb2i.getTableFormatter().truncate();
return sdbdb2i;
}
use of org.apache.jena.sdb.sql.SDBConnection in project jena by apache.
the class StoreCreator method getIndexOracle.
public static Store getIndexOracle() {
if (sdboi == null) {
JDBC.loadDriverOracle();
String url = JDBC.makeURL("oracle:thin", "localhost:1521", "XE");
SDBConnection sdb = new SDBConnection(url, "test2-index", "test2-index");
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesIndex, DatabaseType.Oracle);
sdboi = new StoreTriplesNodesIndexOracle(sdb, desc);
sdboi.getTableFormatter().create();
} else
sdboi.getTableFormatter().truncate();
return sdboi;
}
use of org.apache.jena.sdb.sql.SDBConnection in project jena by apache.
the class StoreCreator method getHashDerby.
public static Store getHashDerby() {
if (sdbdh == null) {
JDBC.loadDriverDerby();
String url = JDBC.makeURL("derby", "localhost", "DB/test2-hash");
SDBConnection sdb = new SDBConnection(url, null, null);
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesHash, DatabaseType.Derby);
sdbdh = new StoreTriplesNodesHashDerby(sdb, desc);
sdbdh.getTableFormatter().create();
} else
sdbdh.getTableFormatter().truncate();
return sdbdh;
}
use of org.apache.jena.sdb.sql.SDBConnection in project jena by apache.
the class StoreCreator method getIndexHSQL.
public static Store getIndexHSQL() {
if (sdbhsi == null) {
JDBC.loadDriverHSQL();
SDBConnection sdb = SDBFactory.createConnection("jdbc:hsqldb:mem:aname", "sa", "");
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesIndex, DatabaseType.HSQLDB);
sdbhsi = new StoreTriplesNodesIndexHSQL(sdb, desc);
sdbhsi.getTableFormatter().create();
} else
sdbhsi.getTableFormatter().truncate();
return sdbhsi;
}
use of org.apache.jena.sdb.sql.SDBConnection in project jena by apache.
the class TestConnection method connection_1.
@Test
public void connection_1() {
SDBConnection conn1 = SDBFactory.createConnection(conn);
Store store1 = StoreFactory.create(storeDesc, conn1);
// Reset
store1.getTableFormatter().format();
SDBConnection conn2 = SDBFactory.createConnection(conn);
Store store2 = StoreFactory.create(storeDesc, conn2);
Model model1 = SDBFactory.connectDefaultModel(store1);
Model model2 = SDBFactory.connectDefaultModel(store2);
Resource s = model1.createResource();
Property p = model1.createProperty("http://example/p");
// These are autocommit so two stores should be OK (but not a good design paradigm)
model1.add(s, p, "model1");
model2.add(s, p, "model2");
assertEquals(2, model1.size());
assertEquals(2, model2.size());
assertTrue(model1.isIsomorphicWith(model2));
}
Aggregations