diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-24 09:50:57 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-24 09:52:38 +0200 |
commit | c67fedbd56623078b6e48b0dd3c015c4b9f8b685 (patch) | |
tree | 5e8ab8e1bb46094d45c8fff2021be212c03e119c /connectivity | |
parent | rhbz#836827: SQLFeatureNotSupportedException only in Java 6 (diff) | |
download | core-c67fedbd56623078b6e48b0dd3c015c4b9f8b685.tar.gz core-c67fedbd56623078b6e48b0dd3c015c4b9f8b685.zip |
To ease debugging, display printStackTrace of caught exceptions in jdbc driver
Change-Id: I8c48b09fcab18af196a8441351bcf3180a32005b
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/jdbc/Object.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Throwable.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/inc/java/lang/Throwable.hxx | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 825a8fab33c6..4d0bdc98fab0 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -180,6 +180,9 @@ namespace else if ( _pEnvironment->IsInstanceOf( jThrow, java_lang_Throwable::st_getMyClass() ) ) { ::std::auto_ptr< java_lang_Throwable > pThrow( new java_lang_Throwable( _pEnvironment, jThrow ) ); +#if OSL_DEBUG_LEVEL > 0 + pThrow->printStackTrace(); +#endif ::rtl::OUString sMessage = pThrow->getMessage(); if ( sMessage.isEmpty() ) sMessage = pThrow->getLocalizedMessage(); diff --git a/connectivity/source/drivers/jdbc/Throwable.cxx b/connectivity/source/drivers/jdbc/Throwable.cxx index b31cf571d52d..e943aec88067 100644 --- a/connectivity/source/drivers/jdbc/Throwable.cxx +++ b/connectivity/source/drivers/jdbc/Throwable.cxx @@ -54,7 +54,13 @@ jclass java_lang_Throwable::st_getMyClass() static jmethodID mID(NULL); return callStringMethod("getLocalizedMessage",mID); } -// ----------------------------------------------------------------------------- +#if OSL_DEBUG_LEVEL > 0 +void java_lang_Throwable::printStackTrace() const +{ + static jmethodID mID(NULL); + return callVoidMethod("printStackTrace",mID); +} +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/java/lang/Throwable.hxx b/connectivity/source/inc/java/lang/Throwable.hxx index e0e90859ea69..071695f001e3 100644 --- a/connectivity/source/inc/java/lang/Throwable.hxx +++ b/connectivity/source/inc/java/lang/Throwable.hxx @@ -39,6 +39,10 @@ namespace connectivity ::rtl::OUString getMessage() const; ::rtl::OUString getLocalizedMessage() const; +#if OSL_DEBUG_LEVEL > 0 + void printStackTrace() const; +#endif + static jclass st_getMyClass(); }; } |