use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FmtLayout2IndexDerby method formatTableNodes.
@Override
protected void formatTableNodes() {
dropTable(TableDescNodes.name());
try {
connection().exec(sqlStr("CREATE TABLE " + TableDescNodes.name() + " (", " id int generated always as identity ,", " hash BIGINT NOT NULL ,", " lex CLOB NOT NULL ,", " lang LONG VARCHAR NOT NULL ,", " datatype varchar(" + TableDescNodes.DatatypeUriLength + ") NOT NULL ,", " type integer NOT NULL ,", " PRIMARY KEY (id)", ")"));
connection().exec("CREATE UNIQUE INDEX Hash ON " + TableDescNodes.name() + " (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 FmtLayout2IndexDerby method formatTableQuads.
@Override
protected void formatTableQuads() {
TableDescQuads desc = new TableDescQuads();
dropTable(desc.getTableName());
try {
String x = sqlStr("CREATE TABLE %s (", " %2$s int NOT NULL,", " %3$s int NOT NULL,", " %4$s int NOT NULL,", " %5$s int NOT NULL,", " PRIMARY KEY (%2$s, %3$s, %4$s, %5$s)", ")");
x = String.format(x, desc.getTableName(), desc.getGraphColName(), desc.getSubjectColName(), desc.getPredicateColName(), desc.getObjectColName());
connection().exec(sqlStr("CREATE TABLE " + desc.getTableName() + " (", " g int NOT NULL,", " s int NOT NULL,", " p int NOT NULL,", " o int NOT NULL,", " 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 FmtLayout2IndexH2 method formatTableNodes.
@Override
protected void formatTableNodes() {
dropTable(TableDescNodes.name());
try {
connection().exec(sqlStr("CREATE TABLE " + TableDescNodes.name() + " (", " id SERIAL,", " hash BIGINT NOT NULL,", " lex CLOB NOT NULL,", " lang varchar NOT NULL default '',", " datatype varchar(" + TableDescNodes.DatatypeUriLength + ") NOT NULL default '',", " type integer NOT NULL default '0',", " PRIMARY KEY (id)", ")"));
connection().exec("CREATE UNIQUE INDEX Hash ON " + TableDescNodes.name() + " (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 FmtLayout2IndexHSQL method formatTableNodes.
@Override
protected void formatTableNodes() {
dropTable(TableDescNodes.name());
try {
connection().exec(sqlStr("CREATE TABLE " + TableDescNodes.name() + " (", " id INT IDENTITY ,", " hash BIGINT NOT NULL ,", " lex VARCHAR NOT NULL ,", " lang VARCHAR(10) default '' NOT NULL ,", " datatype VARCHAR default '' NOT NULL ,", " type int default 0 NOT NULL ,", " PRIMARY KEY (id)", ")"));
connection().exec("CREATE UNIQUE INDEX Hash ON " + TableDescNodes.name() + " (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 FmtLayout2HashH2 method formatTableQuads.
@Override
protected void formatTableQuads() {
String tname = TableDescQuads.name();
dropTable(tname);
try {
connection().exec(sqlStr("CREATE TABLE " + tname + " (", " g BIGINT NOT NULL,", " s BIGINT NOT NULL,", " p BIGINT NOT NULL,", " o BIGINT NOT NULL,", " PRIMARY KEY (g, s, p, o)", ")"));
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException formatting table '" + TableDescTriples.name() + "'", ex);
}
}
Aggregations