org.itsallcode.jdbc.UncheckedSQLException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-jdbc Show documentation
Show all versions of simple-jdbc Show documentation
Library to simplify using JDBC
package org.itsallcode.jdbc;
import java.sql.SQLException;
/**
* This unchecked exception is thrown whenever a checked {@link SQLException} is
* thrown.
*/
public class UncheckedSQLException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* Create a new instance.
*
* @param cause the cause
*/
public UncheckedSQLException(final SQLException cause) {
super(cause);
}
/**
* Create a new instance.
*
* @param message error message
* @param cause cause
*/
public UncheckedSQLException(final String message, final SQLException cause) {
super(message + ": " + cause.getMessage(), cause);
}
}