use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FmtLayout2IndexSAP method formatTableQuads.
@Override
protected void formatTableQuads() {
dropTable(TableDescQuads.name());
try {
connection().exec(sqlStr("CREATE " + storageType.getStorageName() + " TABLE " + TableDescQuads.name() + " (", " g integer NOT NULL,", " s integer NOT NULL,", " p integer NOT NULL,", " o integer NOT NULL", ")"));
connection().exec(sqlStr("ALTER TABLE " + TableDescQuads.name() + " 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 FmtLayout2IndexSQLServer method formatTableNodes.
@Override
protected void formatTableNodes() {
dropTable(TableDescNodes.name());
try {
connection().exec(sqlStr("CREATE TABLE " + TableDescNodes.name() + " (", " id INT IDENTITY (1, 1) NOT NULL ,", " hash BIGINT NOT NULL,", // NVARCHAR(max) better but not in SQL Server 2000
" lex NTEXT NOT NULL,", " lang NVARCHAR(10) NOT NULL DEFAULT '',", " datatype NVARCHAR(" + TableDescNodes.DatatypeUriLength + ") NOT NULL default '',", " type INT 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);
}
}
Aggregations