Search in sources :

Example 6 with StoreDesc

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;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

Example 7 with StoreDesc

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;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

Example 8 with StoreDesc

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;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

Example 9 with StoreDesc

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);
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) Connection(java.sql.Connection) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

Example 10 with StoreDesc

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;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) Dataset(org.apache.jena.query.Dataset)

Aggregations

StoreDesc (org.apache.jena.sdb.StoreDesc)27 SDBConnection (org.apache.jena.sdb.sql.SDBConnection)19 Store (org.apache.jena.sdb.Store)4 Resource (org.apache.jena.rdf.model.Resource)3 Connection (java.sql.Connection)2 CmdException (jena.cmd.CmdException)1 TestSuite (junit.framework.TestSuite)1 Graph (org.apache.jena.graph.Graph)1 Dataset (org.apache.jena.query.Dataset)1 SDBException (org.apache.jena.sdb.SDBException)1 SDBConnectionDesc (org.apache.jena.sdb.sql.SDBConnectionDesc)1 DatasetStore (org.apache.jena.sdb.store.DatasetStore)1 Feature (org.apache.jena.sdb.store.Feature)1 FeatureSet (org.apache.jena.sdb.store.FeatureSet)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1