Search in sources :

Example 1 with StoreDesc

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

the class sdbprint method processModulesAndArgs.

@Override
protected void processModulesAndArgs() {
    // Force the connection to be a null one.
    // Known to be called after arg module initialization.
    StoreDesc storeDesc = getModStore().getStoreDesc();
    storeDesc.connDesc.setJdbcURL(JDBC.jdbcNone);
    if (storeDesc.getLayout() == null)
        storeDesc.setLayout(layoutDefault);
    printSQL = contains(argDeclPrintSQL);
    List<String> strList = getValues(argDeclPrint);
    for (String arg : strList) {
        if (arg.equalsIgnoreCase("query")) {
            printQuery = true;
        } else if (arg.equalsIgnoreCase("Op")) {
            printOp = true;
        } else if (arg.equalsIgnoreCase("SqlNode")) {
            printSqlNode = true;
        } else if (arg.equalsIgnoreCase("sql")) {
            printSQL = true;
        } else if (arg.equalsIgnoreCase("plan")) {
            printPlan = true;
        } else
            throw new CmdException("Not a recognized print form: " + arg + " : Choices are: query, prefix, op, sqlNode, sql");
    }
}
Also used : CmdException(jena.cmd.CmdException) StoreDesc(org.apache.jena.sdb.StoreDesc)

Example 2 with StoreDesc

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

Example 3 with StoreDesc

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

Example 4 with StoreDesc

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

Example 5 with StoreDesc

use of org.apache.jena.sdb.StoreDesc 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;
}
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