use of org.jooq.exception.DataAccessException in project jOOQ by jOOQ.
the class DefaultConnectionProvider method setReadOnly.
/**
* Convenience method to access {@link Connection#setReadOnly(boolean)}.
*/
public final void setReadOnly(boolean readOnly) throws DataAccessException {
try {
log.debug("setting read only", readOnly);
connection.setReadOnly(readOnly);
} catch (Exception e) {
throw new DataAccessException("Cannot set readOnly", e);
}
}
use of org.jooq.exception.DataAccessException in project jOOQ by jOOQ.
the class DefaultConnectionProvider method releaseSavepoint.
/**
* Convenience method to access
* {@link Connection#releaseSavepoint(Savepoint)}.
*/
public final void releaseSavepoint(Savepoint savepoint) throws DataAccessException {
try {
log.debug("release savepoint");
connection.releaseSavepoint(savepoint);
} catch (Exception e) {
throw new DataAccessException("Cannot release savepoint", e);
}
}
use of org.jooq.exception.DataAccessException in project jOOQ by jOOQ.
the class DefaultConnectionProvider method setTransactionIsolation.
/**
* Convenience method to access
* {@link Connection#setTransactionIsolation(int)}.
*/
public final void setTransactionIsolation(int level) throws DataAccessException {
try {
log.debug("setting tx isolation", level);
connection.setTransactionIsolation(level);
} catch (Exception e) {
throw new DataAccessException("Cannot set transactionIsolation", e);
}
}
use of org.jooq.exception.DataAccessException in project jOOQ by jOOQ.
the class DefaultConnectionProvider method setAutoCommit.
/**
* Convenience method to access {@link Connection#setAutoCommit(boolean)}.
*/
public final void setAutoCommit(boolean autoCommit) throws DataAccessException {
try {
log.debug("setting auto commit", autoCommit);
connection.setAutoCommit(autoCommit);
} catch (Exception e) {
throw new DataAccessException("Cannot set autoCommit", e);
}
}
use of org.jooq.exception.DataAccessException in project jOOQ by jOOQ.
the class DefaultDSLContext method fetchFromCSV.
@Override
public Result<Record> fetchFromCSV(String string, boolean header, char delimiter) {
CSVReader reader = new CSVReader(new StringReader(string), delimiter);
List<String[]> list = null;
try {
list = reader.readAll();
} catch (IOException e) {
throw new DataAccessException("Could not read the CSV string", e);
} finally {
try {
reader.close();
} catch (IOException ignore) {
}
}
return fetchFromStringData(list, header);
}
Aggregations