/** * Create a database exception for a specific error code. * * @param errorCode the error code * @param params the list of parameters of the message * @return the exception */ public static DbException get(int errorCode, String... params) { return new DbException(getJdbcSQLException(errorCode, null, params)); }
/** * Create a database exception for a specific error code. * * @param errorCode the error code * @param cause the cause of the exception * @param params the list of parameters of the message * @return the exception */ public static DbException get(int errorCode, Throwable cause, String... params) { return new DbException(getJdbcSQLException(errorCode, cause, params)); }
/** * Create a syntax error exception. * * @param sql the SQL statement * @param index the position of the error in the SQL statement * @param message the message * @return the exception */ public static DbException getSyntaxError(String sql, int index, String message) { sql = StringUtils.addAsterisk(sql, index); return new DbException(getJdbcSQLException(ErrorCode.SYNTAX_ERROR_2, null, sql, message)); }
/** * Create a database exception for a specific error code. * * @param errorCode the error code * @param cause the cause of the exception * @param params the list of parameters of the message * @return the exception */ public static DbException get(int errorCode, Throwable cause, String... params) { return new DbException(getJdbcSQLException(errorCode, cause, params)); }
/** * Create a database exception for a specific error code. * * @param errorCode the error code * @param params the list of parameters of the message * @return the exception */ public static DbException get(int errorCode, String... params) { return new DbException(getJdbcSQLException(errorCode, null, params)); }
/** * Create a database exception for a specific error code. * * @param errorCode the error code * @param cause the cause of the exception * @param params the list of parameters of the message * @return the exception */ public static DbException get(int errorCode, Throwable cause, String... params) { return new DbException(getJdbcSQLException(errorCode, cause, params)); }
/** * Create a database exception for a specific error code. * * @param errorCode the error code * @param params the list of parameters of the message * @return the exception */ public static DbException get(int errorCode, String... params) { return new DbException(getJdbcSQLException(errorCode, null, params)); }
/** * Create a syntax error exception. * * @param sql the SQL statement * @param index the position of the error in the SQL statement * @param message the message * @return the exception */ public static DbException getSyntaxError(String sql, int index, String message) { sql = StringUtils.addAsterisk(sql, index); return new DbException(getJdbcSQLException(ErrorCode.SYNTAX_ERROR_2, null, sql, message)); }
/** * Create a syntax error exception. * * @param sql the SQL statement * @param index the position of the error in the SQL statement * @param message the message * @return the exception */ public static DbException getSyntaxError(String sql, int index, String message) { sql = StringUtils.addAsterisk(sql, index); return new DbException(getJdbcSQLException(ErrorCode.SYNTAX_ERROR_2, null, sql, message)); }