use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FmtLayout2HashSAP method formatTableNodes.
@Override
protected void formatTableNodes() {
String tname = TableDescNodes.name();
dropTable(tname);
try {
connection().exec(sqlStr("CREATE " + storageType.getStorageName() + " TABLE " + tname + " (", " hash BIGINT NOT NULL,", " lex nvarchar(5000) NOT NULL,", " lang nvarchar (10) NOT NULL default '',", " datatype nvarchar(" + TableDescNodes.DatatypeUriLength + ") NOT NULL default '',", " type integer NOT NULL default '0'", ")"));
connection().exec(sqlStr("ALTER TABLE " + tname + " ADD PRIMARY KEY (hash)"));
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException formatting table '" + TableDescNodes.name() + "'", ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FmtLayout2HashSAP method formatTablePrefixes.
@Override
protected void formatTablePrefixes() {
String tname = TablePrefixes.name();
dropTable(tname);
try {
connection().exec(sqlStr("CREATE " + storageType.getStorageName() + " TABLE " + tname + " (", " prefix NVARCHAR(" + TablePrefixes.prefixColWidth + ") NOT NULL ,", " uri NVARCHAR(" + TablePrefixes.uriColWidth + ") NOT NULL", ")"));
connection().exec(sqlStr("ALTER TABLE " + tname + " ADD CONSTRAINT " + tname + "_PK PRIMARY KEY (prefix)"));
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException resetting table '" + TablePrefixes.name() + "'", ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FmtLayout2HashSAP method formatTableTriples.
@Override
protected void formatTableTriples() {
String tname = TableDescTriples.name();
dropTable(tname);
try {
connection().exec(sqlStr("CREATE " + storageType.getStorageName() + " TABLE " + tname + " (", " s BIGINT NOT NULL,", " p BIGINT NOT NULL,", " o BIGINT NOT NULL", ")"));
connection().exec(sqlStr("ALTER TABLE " + tname + " ADD PRIMARY KEY (s, p, o)"));
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException formatting table '" + TableDescTriples.name() + "'", ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FmtLayout2HashSAP method formatTableQuads.
@Override
protected void formatTableQuads() {
String tname = TableDescQuads.name();
dropTable(tname);
try {
connection().exec(sqlStr("CREATE " + storageType.getStorageName() + " TABLE " + tname + " (", " g BIGINT NOT NULL,", " s BIGINT NOT NULL,", " p BIGINT NOT NULL,", " o BIGINT NOT NULL", ")"));
connection().exec(sqlStr("ALTER TABLE " + tname + " ADD PRIMARY KEY (g, s, p, o)"));
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException formatting table '" + TableDescTriples.name() + "'", ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FormatterSimpleOracle 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);
}
}
Aggregations