// Open the TDB dataset
try {
Dataset tdb = useMem ? TDBFactory.createDataset() : TDBFactory.createDataset(location);
// Return a new connection for the TDB dataset
return new TDBConnection(tdb, ResultSet.HOLD_CURSORS_OVER_COMMIT, true, compatibilityLevel);
} catch (SQLException e) {
throw e;
} catch (Exception e) {
throw new SQLException("Unexpected error establishing TDB driver connection, see inner exception for details", e);
}