From f47df08a66c99594f41f14dcf2556b4dd2baf93c Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Wed, 17 Sep 2008 11:46:01 +0000 Subject: [PATCH] FR [ 2115814 ] DBException should store SQL Query String too --- .../org/adempiere/exceptions/DBException.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/base/src/org/adempiere/exceptions/DBException.java b/base/src/org/adempiere/exceptions/DBException.java index 26efb62fa0..591e7b3872 100644 --- a/base/src/org/adempiere/exceptions/DBException.java +++ b/base/src/org/adempiere/exceptions/DBException.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * + * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * @@ -28,8 +28,11 @@ import java.sql.SQLException; * * @author Teo Sarca, SC ARHIPAC SERVICE SRL */ -public class DBException extends AdempiereException { +public class DBException extends AdempiereException +{ private static final long serialVersionUID = 1L; + + private String m_sql = null; /** * Create a new DBException based on a SQLException @@ -39,6 +42,17 @@ public class DBException extends AdempiereException { { super(e); } // DBException + + /** + * Create a new DBException based on a SQLException and SQL Query + * @param e exception + * @param sql sql query + */ + public DBException(SQLException e, String sql) + { + super(e); + m_sql = sql; + } /** * Create a new DBException @@ -48,6 +62,14 @@ public class DBException extends AdempiereException { { super(msg); } // DBException + + /** + * @return SQL Query or null + */ + public String getSQL() + { + return m_sql; + } /** * @return Wrapped SQLException or null