use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class PrefixMappingSDB method insertIntoPrefixMap.
private void insertIntoPrefixMap(String prefix, String uri) {
// Assumes not present in the persistent table.
try {
prefix = encode(prefix);
String sqlStmt = sqlStr("INSERT INTO " + prefixTableName, " VALUES (" + quoteStr(prefix) + ", " + quoteStr(uri) + ")");
connection.execUpdate(sqlStmt);
} catch (SQLException ex) {
throw new SDBExceptionSQL(format("Failed to set prefix (%s,%s)", prefix, uri), ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class PrefixMappingSDB method removeFromPrefixMap.
private void removeFromPrefixMap(String prefix, String uri) {
try {
prefix = encode(prefix);
String sqlStmt = sqlStr("DELETE FROM " + prefixTableName + " WHERE", //+" AND uri = "+quote(uri)
" prefix = " + quoteStr(prefix));
connection.execUpdate(sqlStmt);
} catch (SQLException ex) {
throw new SDBExceptionSQL(format("Failed to remove prefix (%s,%s)", prefix, uri), ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class TransactionHandlerSDB method commit.
@Override
public synchronized void commit() {
if (!inTransaction) {
log.warn("commit: Not in a transaction");
return;
}
try {
sqlConnection.commit();
sqlConnection.setAutoCommit(true);
inTransaction = false;
} catch (SQLException ex) {
new SDBExceptionSQL("commit", ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FormatterSimpleH2 method dropIndexes.
@Override
public void dropIndexes() {
try {
connection().exec("DROP INDEX IF EXISTS PredObj");
connection().exec("DROP INDEX IF EXISTS ObjSubj");
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException dropping indexes for table 'Triples'", ex);
}
}
use of org.apache.jena.sdb.sql.SDBExceptionSQL in project jena by apache.
the class FormatterSimpleHSQL method dropIndexes.
@Override
public void dropIndexes() {
try {
connection().exec("DROP INDEX PredObj IF EXISTS");
connection().exec("DROP INDEX ObjSubj IF EXISTS");
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException dropping indexes for table 'Triples'", ex);
}
}
Aggregations