use of org.apache.jena.sdb.StoreDesc in project jena by apache.
the class StoreCreator method getIndexPgSQL.
public static Store getIndexPgSQL() {
if (sdbpgi == null) {
JDBC.loadDriverPGSQL();
SDBConnection sdb = SDBFactory.createConnection("jdbc:postgresql://localhost/test2-index", "user", "password");
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesIndex, DatabaseType.PostgreSQL);
sdbpgi = new StoreTriplesNodesIndexPGSQL(sdb, desc);
sdbpgi.getTableFormatter().create();
} else
sdbpgi.getTableFormatter().truncate();
return sdbpgi;
}
use of org.apache.jena.sdb.StoreDesc in project jena by apache.
the class StoreCreator method getIndexSQLServer.
public static Store getIndexSQLServer() {
if (sdbssi == null) {
JDBC.loadDriverSQLServer();
SDBConnection sdb = SDBFactory.createConnection(MSSQL_url + "test2-index", MSSQL_user, MSSQL_password);
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesIndex, DatabaseType.SQLServer);
sdbssi = new StoreTriplesNodesIndexSQLServer(sdb, desc);
sdbssi.getTableFormatter().create();
} else
sdbssi.getTableFormatter().truncate();
return sdbssi;
}
use of org.apache.jena.sdb.StoreDesc in project jena by apache.
the class StoreCreator method getHashSAP.
public static Store getHashSAP() {
if (sdbsaph == null) {
JDBC.loadDriverSAP();
SDBConnection sdb = SDBFactory.createConnection("jdbc:sap://localhost/test2-hash", "user", "password");
StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesHash, DatabaseType.SAP);
sdbsaph = new StoreTriplesNodesHashSAP(sdb, desc);
sdbsaph.getTableFormatter().create();
} else
sdbsaph.getTableFormatter().truncate();
return sdbsaph;
}
use of org.apache.jena.sdb.StoreDesc in project jena by apache.
the class ExJdbcConnection method main.
public static void main(String... argv) {
String jdbcURL = String.format("jdbc:derby:%s", "DB/test2-hash");
JDBC.loadDriverDerby();
// Setup - make the JDBC connection and read the store description once.
Connection jdbc = makeConnection(jdbcURL);
//StoreDesc storeDesc = StoreDesc.read("sdb-store.ttl") ;
// Make a store description without any connection information.
StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash, DatabaseType.Derby);
// Make some calls to the store, using the same JDBC connection and store description.
System.out.println("Subjects: ");
query("SELECT DISTINCT ?s { ?s ?p ?o }", storeDesc, jdbc);
System.out.println("Predicates: ");
query("SELECT DISTINCT ?p { ?s ?p ?o }", storeDesc, jdbc);
System.out.println("Objects: ");
query("SELECT DISTINCT ?o { ?s ?p ?o }", storeDesc, jdbc);
}
use of org.apache.jena.sdb.StoreDesc in project jena by apache.
the class DatasetStoreAssembler method open.
@Override
public Dataset open(Assembler a, Resource root, Mode mode) {
StoreDesc desc = openStore(a, root, mode);
Dataset ds = SDBFactory.connectDataset(desc);
AssemblerUtils.setContext(root, ds.getContext());
return ds;
}
Aggregations