use of org.apache.jena.sdb.SDBException in project jena by apache.
the class FormatterSimpleHSQL method reformatDataWorker.
private void reformatDataWorker() {
try {
connection().exec("DROP TABLE IF EXISTS Triples");
connection().exec(sqlStr("CREATE CACHED TABLE Triples", "(", " s " + colDecl + " ,", " p " + colDecl + " ,", " o " + colDecl + " ,", " PRIMARY KEY (s,p,o)", ")"));
} catch (SQLException ex) {
log.warn("Exception resetting table 'Triples'");
throw new SDBException("SQLException resetting table 'Triples'", ex);
}
}
use of org.apache.jena.sdb.SDBException in project jena by apache.
the class FormatterSimpleMySQL method reformatPrefixesWorker.
private void reformatPrefixesWorker(boolean loadPrefixes) {
try {
connection().exec("DROP TABLE IF EXISTS Prefixes");
connection().exec(sqlStr("CREATE TABLE Prefixes (", " prefix VARCHAR(" + TablePrefixes.prefixColWidth + ") BINARY NOT NULL ,", " uri VARCHAR(" + TablePrefixes.uriColWidth + ") BINARY NOT NULL ,", " PRIMARY KEY(prefix)", ") ENGINE=" + engineType.getEngineName()));
if (loadPrefixes) {
connection().execUpdate("INSERT INTO Prefixes VALUES ('x', 'http://example/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('ex', 'http://example.org/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('xsd', 'http://www.w3.org/2001/XMLSchema#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('owl' , 'http://www.w3.org/2002/07/owl#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('foaf', 'http://xmlns.com/foaf/0.1/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('dc', 'http://purl.org/dc/elements/1.1/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('dcterms', 'http://purl.org/dc/terms/')");
}
} catch (SQLException ex) {
log.warn("Exception resetting table 'Prefixes'");
throw new SDBException("SQLException resetting table 'Prefixes'", ex);
}
}
use of org.apache.jena.sdb.SDBException in project jena by apache.
the class FormatterSimple method addIndexes.
@Override
public void addIndexes() {
try {
connection().exec("CREATE INDEX PredObj ON " + TableDescSPO.name() + " (p, o)");
connection().exec("CREATE INDEX ObjSubj ON " + TableDescSPO.name() + " (o, s)");
} catch (SQLException ex) {
throw new SDBException("SQLException indexing table 'Triples'", ex);
}
}
use of org.apache.jena.sdb.SDBException in project jena by apache.
the class FormatterSimpleDB2 method reformatPrefixesWorker.
private void reformatPrefixesWorker(boolean loadPrefixes) {
try {
dropTable("Prefixes");
connection().exec(sqlStr("CREATE TABLE Prefixes (", " prefix VARCHAR (" + TablePrefixes.prefixColWidth + ") NOT NULL ,", " uri VARCHAR(" + TablePrefixes.uriColWidth + ") NOT NULL ,", " PRIMARY KEY(prefix)", ") CCSID UNICODE"));
if (loadPrefixes) {
connection().execUpdate("INSERT INTO Prefixes VALUES ('x', 'http://example/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('ex', 'http://example.org/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('xsd', 'http://www.w3.org/2001/XMLSchema#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('owl' , 'http://www.w3.org/2002/07/owl#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('foaf', 'http://xmlns.com/foaf/0.1/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('dc', 'http://purl.org/dc/elements/1.1/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('dcterms', 'http://purl.org/dc/terms/')");
}
} catch (SQLException ex) {
log.warn("Exception resetting table 'Prefixes'");
throw new SDBException("SQLException resetting table 'Prefixes'", ex);
}
}
use of org.apache.jena.sdb.SDBException in project jena by apache.
the class FormatterSimpleDerby method reformatPrefixesWorker.
private void reformatPrefixesWorker(boolean loadPrefixes) {
try {
dropTable("Prefixes");
connection().exec(sqlStr("CREATE TABLE Prefixes (", " prefix VARCHAR(" + TablePrefixes.prefixColWidth + ") NOT NULL ,", " uri VARCHAR(" + TablePrefixes.uriColWidth + ") NOT NULL ,", " PRIMARY KEY(prefix)", ")"));
if (loadPrefixes) {
connection().execUpdate("INSERT INTO Prefixes VALUES ('x', 'http://example/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('ex', 'http://example.org/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('rdfs', 'http://www.w3.org/2000/01/rdf-schema#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('xsd', 'http://www.w3.org/2001/XMLSchema#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('owl' , 'http://www.w3.org/2002/07/owl#')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('foaf', 'http://xmlns.com/foaf/0.1/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('dc', 'http://purl.org/dc/elements/1.1/')");
connection().execUpdate("INSERT INTO Prefixes VALUES ('dcterms', 'http://purl.org/dc/terms/')");
}
} catch (SQLException ex) {
log.warn("Exception resetting table 'Prefixes'");
throw new SDBException("SQLException resetting table 'Prefixes'", ex);
}
}
Aggregations