Search in sources :

Example 11 with SDBExceptionSQL

use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.

the class FmtLayout2HashH2 method formatTableNodes.

@Override
protected void formatTableNodes() {
    String tname = TableDescNodes.name();
    dropTable(tname);
    try {
        connection().exec(sqlStr("CREATE TABLE " + tname + " (", "   hash BIGINT NOT NULL,", "   lex CLOB NOT NULL,", "   lang varchar NOT NULL default E'',", "   datatype varchar(" + TableDescNodes.DatatypeUriLength + ") NOT NULL default '',", "   type integer NOT NULL default E'0',", "   PRIMARY KEY (hash)", ")"));
    } catch (SQLException ex) {
        throw new SDBExceptionSQL("SQLException formatting table '" + TableDescNodes.name() + "'", ex);
    }
}
Also used : SDBExceptionSQL(org.apache.jena.sdb.sql.SDBExceptionSQL) SQLException(java.sql.SQLException)

Example 12 with SDBExceptionSQL

use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.

the class FmtLayout2HashPGSQL method formatTablePrefixes.

@Override
protected void formatTablePrefixes() {
    String tname = TablePrefixes.name();
    dropTable(tname);
    try {
        connection().exec(sqlStr("CREATE TABLE " + tname + " (", "    prefix VARCHAR(" + TablePrefixes.prefixColWidth + ") NOT NULL ,", "    uri VARCHAR(" + TablePrefixes.uriColWidth + ") NOT NULL ,", "    CONSTRAINT " + tname + "_PK PRIMARY KEY  (prefix)", ")"));
    } catch (SQLException ex) {
        throw new SDBExceptionSQL("SQLException resetting table '" + TablePrefixes.name() + "'", ex);
    }
}
Also used : SDBExceptionSQL(org.apache.jena.sdb.sql.SDBExceptionSQL) SQLException(java.sql.SQLException)

Example 13 with SDBExceptionSQL

use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.

the class FormatterSimpleSQLServer method dropIndexes.

@Override
public void dropIndexes() {
    try {
        connection().exec("DROP INDEX " + TableDescSPO.name() + ".PredObj");
        connection().exec("DROP INDEX " + TableDescSPO.name() + ".ObjSubj");
    } catch (SQLException ex) {
        throw new SDBExceptionSQL("SQLException dropping indexes for table 'Triples'", ex);
    }
}
Also used : SDBExceptionSQL(org.apache.jena.sdb.sql.SDBExceptionSQL) SQLException(java.sql.SQLException)

Example 14 with SDBExceptionSQL

use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.

the class FmtLayout2HashPGSQL method formatTableTriples.

@Override
protected void formatTableTriples() {
    String tname = TableDescTriples.name();
    dropTable(tname);
    try {
        connection().exec(sqlStr("CREATE TABLE " + tname + " (", "    s BIGINT NOT NULL,", "    p BIGINT NOT NULL,", "    o BIGINT NOT NULL,", "    PRIMARY KEY (s, p, o)", ")"));
    } catch (SQLException ex) {
        throw new SDBExceptionSQL("SQLException formatting table '" + TableDescTriples.name() + "'", ex);
    }
}
Also used : SDBExceptionSQL(org.apache.jena.sdb.sql.SDBExceptionSQL) SQLException(java.sql.SQLException)

Example 15 with SDBExceptionSQL

use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.

the class FmtLayout2HashPGSQL method formatTableNodes.

@Override
protected void formatTableNodes() {
    String tname = TableDescNodes.name();
    dropTable(tname);
    try {
        connection().exec(sqlStr("CREATE TABLE " + tname + " (", "   hash BIGINT NOT NULL,", "   lex TEXT NOT NULL,", "   lang varchar NOT NULL default E'',", "   datatype varchar(" + TableDescNodes.DatatypeUriLength + ") NOT NULL default '',", "   type integer NOT NULL default E'0',", "   PRIMARY KEY (hash)", ")"));
    } catch (SQLException ex) {
        throw new SDBExceptionSQL("SQLException formatting table '" + TableDescNodes.name() + "'", ex);
    }
}
Also used : SDBExceptionSQL(org.apache.jena.sdb.sql.SDBExceptionSQL) SQLException(java.sql.SQLException)

Aggregations

SQLException (java.sql.SQLException)47 SDBExceptionSQL (org.apache.jena.sdb.sql.SDBExceptionSQL)47 ResultSetJDBC (org.apache.jena.sdb.sql.ResultSetJDBC)8 ResultSet (java.sql.ResultSet)4 ArrayList (java.util.ArrayList)1 SDBException (org.apache.jena.sdb.SDBException)1 SDBRequest (org.apache.jena.sdb.core.SDBRequest)1 TableDescQuads (org.apache.jena.sdb.layout2.TableDescQuads)1 TableDescTriples (org.apache.jena.sdb.layout2.TableDescTriples)1 ExecutionContext (org.apache.jena.sparql.engine.ExecutionContext)1 Context (org.apache.jena.sparql.util.Context)1