Search in sources :

Example 16 with StoreDesc

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

Example 17 with StoreDesc

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

Example 18 with StoreDesc

use of org.apache.jena.sdb.StoreDesc in project jena by apache.

the class StoreCreator method getHashSQLServer.

public static Store getHashSQLServer() {
    if (sdbssh == null) {
        JDBC.loadDriverSQLServer();
        SDBConnection sdb = SDBFactory.createConnection(MSSQL_url + "test2-hash", MSSQL_user, MSSQL_password);
        StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesHash, DatabaseType.SQLServer);
        sdbssh = new StoreTriplesNodesHashSQLServer(sdb, desc);
        sdbssh.getTableFormatter().create();
    } else
        sdbssh.getTableFormatter().truncate();
    return sdbssh;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

Example 19 with StoreDesc

use of org.apache.jena.sdb.StoreDesc in project jena by apache.

the class StoreCreator method getHashOracle.

public static Store getHashOracle() {
    if (sdboh == null) {
        JDBC.loadDriverOracle();
        // "jena", "swara"
        String url = JDBC.makeURL("oracle:thin", "localhost:1521", "XE");
        SDBConnection sdb = new SDBConnection(url, "test2-hash", "test2-hash");
        StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesHash, DatabaseType.Oracle);
        sdboh = new StoreTriplesNodesHashOracle(sdb, desc);
        sdboh.getTableFormatter().create();
    } else
        sdboh.getTableFormatter().truncate();
    return sdboh;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

Example 20 with StoreDesc

use of org.apache.jena.sdb.StoreDesc in project jena by apache.

the class StoreCreator method getIndexDerby.

public static Store getIndexDerby() {
    if (sdbdi == null) {
        JDBC.loadDriverDerby();
        String url = JDBC.makeURL("derby", "localhost", "DB/test2-index");
        SDBConnection sdb = new SDBConnection(url, null, null);
        StoreDesc desc = new StoreDesc(LayoutType.LayoutTripleNodesIndex, DatabaseType.Derby);
        sdbdi = new StoreTriplesNodesIndexDerby(sdb, desc);
        sdbdi.getTableFormatter().create();
    } else
        sdbdi.getTableFormatter().truncate();
    return sdbdi;
}
Also used : StoreDesc(org.apache.jena.sdb.StoreDesc) SDBConnection(org.apache.jena.sdb.sql.SDBConnection)

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