com.j256.ormlite.misc.SqlExceptionUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ormlite-core Show documentation
Show all versions of ormlite-core Show documentation
Lightweight Object Relational Model (ORM) for persisting objects to SQL databases.
package com.j256.ormlite.misc;
import java.sql.SQLException;
/**
* Utility class to help with SQLException throwing.
*
* @author graywatson
*/
public class SqlExceptionUtil {
/**
* Should be used in a static context only.
*/
private SqlExceptionUtil() {
}
/**
* Convenience method to allow a cause. Grrrr.
*/
public static SQLException create(String message, Throwable cause) {
SQLException sqlException = new SQLException(message);
sqlException.initCause(cause);
return sqlException;
}
}