summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/jdbc/Object.cxx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-05-09 11:59:06 +0000
committerOcke Janssen <oj@openoffice.org>2001-05-09 11:59:06 +0000
commit0223e3fb8ac21a9d72ba5781ba367bbcbf9450e5 (patch)
tree617ba4e5b0df5abb081838d3a93690d019424ea9 /connectivity/source/drivers/jdbc/Object.cxx
parent904761fc639e4bab5e1826406d051784043e7f03 (diff)
correct the java Properties
Diffstat (limited to 'connectivity/source/drivers/jdbc/Object.cxx')
-rw-r--r--connectivity/source/drivers/jdbc/Object.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx
index 8ba9fec83b..da26014fce 100644
--- a/connectivity/source/drivers/jdbc/Object.cxx
+++ b/connectivity/source/drivers/jdbc/Object.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Object.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jl $ $Date: 2001-03-20 17:03:17 $
+ * last change: $Author: oj $ $Date: 2001-05-09 12:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -384,12 +384,24 @@ void java_lang_Object::ThrowSQLException(JNIEnv * pEnv,const Reference< XInterfa
{
if(pEnv->IsInstanceOf(jThrow,java_sql_SQLException_BASE::getMyClass()))
{
- throw java_sql_SQLException(java_sql_SQLException_BASE(pEnv,jThrow),_rContext);
+ java_sql_SQLException_BASE* pException = new java_sql_SQLException_BASE(pEnv,jThrow);
+ SQLException e( pException->getMessage(),
+ _rContext,
+ pException->getSQLState(),
+ pException->getErrorCode(),
+ makeAny(pException->getNextException())
+ );
+ delete pException;
+ throw e;
}
else if(pEnv->IsInstanceOf(jThrow,java_lang_Throwable::getMyClass()))
{
java_lang_Throwable *pThrow = new java_lang_Throwable(pEnv,jThrow);
::rtl::OUString aMsg = pThrow->getMessage();
+ if(!aMsg.getLength())
+ aMsg = pThrow->getLocalizedMessage();
+ if(!aMsg.getLength())
+ aMsg = pThrow->toString();
delete pThrow;
throw SQLException(aMsg,_rContext,::rtl::OUString(),-1,Any());
}