📄 jahiadatabaseexception.java
字号:
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .//package org.jahia.exceptions.database;import java.sql.SQLException;import org.jahia.exceptions.JahiaException;/** This exception is used to raise a database exception. * * @author Fulco Houkes * @version 1.0 */public class JahiaDatabaseException extends JahiaException { private SQLException mSQLException = null; private String mQuery = null; //------------------------------------------------------------------------- // Foux 29 Mar. 2001 // Initial implementation // /** Default constructor. * * @param message * Error message displayed only in the Jahia console. * @param query * String representing the query that generated the error. * @param ex * The SQL exception associated with the exception. * <b>MUST BE NON-NULL!</b> * @param severity * Severity code. */ public JahiaDatabaseException (String message, String query, SQLException ex, int severity) { super ("An Database error occured", "Database: "+ message +" while excuting query ["+ query + "]\n SQLException : "+ex.getMessage(), DATABASE_ERROR, severity); mSQLException = ex; mQuery = query; } //------------------------------------------------------------------------- // Foux 29 Mar. 2001 // Initial implementation // /** Default constructor. * * @param message * Error message displayed only in the Jahia console. * @param ex * The SQL exception associated with the exception. * <b>MUST BE NON-NULL!</b> * @param severity * Severity code. */ public JahiaDatabaseException (String message, SQLException ex, int severity) { super ("An Database error occured", "Database: "+ message +"\n SQLException : "+ex.getMessage(), DATABASE_ERROR, severity); mSQLException = ex; } //------------------------------------------------------------------------- // Foux 29 Mar. 2001 // Initial implementation // /** Instanciate a <code>JahiaDatabaseException</code>. * @param message * Error message displayed only in the Jahia console. * @param query * String representing the query that generated the error. * @param severity * Severity code. */ public JahiaDatabaseException (String message, String query, int severity) { super ("An database error occured", "Database: "+message+" while executing query ["+query+"]", DATABASE_ERROR, severity); mQuery = query; } //------------------------------------------------------------------------- // Foux 29 Mar. 2001 // Initial implementation // /** Instanciate a <code>JahiaDatabaseException</code>. * @param message * Error message displayed only in the Jahia console. * @param severity * Severity code. */ public JahiaDatabaseException (String message, int severity) { super ("An database error occured", "Database: "+message, DATABASE_ERROR, severity); } //------------------------------------------------------------------------- // Foux 29 Mar. 2001 // Initial implementation // /** Return the reference on the SQL exception. If no SQL exception occured, * this method return <code>null</code>. * * @return * Return the SQL exception reference, or <code>null</code> if no * SQL exception */ public SQLException getSQLException () { return mSQLException; } //------------------------------------------------------------------------- // Foux 29 Mar. 2001 // Initial implementation // /** Return the query that generated the exception. If the exception source * is not due to a query execution, null is returned. * * @return * Return the query, or null if the exception was not generated after * a query execution. */ public String getQuery () { return mQuery; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -