summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/jdbc/Object.cxx
diff options
context:
space:
mode:
authorOcke Janssen <Ocke.Janssen@sun.com>2009-11-11 13:27:33 +0100
committerOcke Janssen <Ocke.Janssen@sun.com>2009-11-11 13:27:33 +0100
commit4c80d22b3614487bbfe4ec80ea277273680f7b87 (patch)
tree8a55dc263aa117fddfee95b16796e86c104009f0 /connectivity/source/drivers/jdbc/Object.cxx
parent90296562642184e0deec04536626f195fa672b7a (diff)
#i105086# fix for clob and blob
Diffstat (limited to 'connectivity/source/drivers/jdbc/Object.cxx')
-rw-r--r--connectivity/source/drivers/jdbc/Object.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx
index b8e8c87954..72f3731f5a 100644
--- a/connectivity/source/drivers/jdbc/Object.cxx
+++ b/connectivity/source/drivers/jdbc/Object.cxx
@@ -43,7 +43,7 @@
#include <vos/mutex.hxx>
#include <osl/thread.h>
#include <com/sun/star/uno/Sequence.hxx>
-
+#include "java/LocalRef.hxx"
#include "resource/jdbc_log.hrc"
#include <rtl/logfile.hxx>
#include <comphelper/logging.hxx>
@@ -395,10 +395,9 @@ void java_lang_Object::callVoidMethodWithStringArg( const char* _pMethodName, jm
OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java enviroment anymore!" );
obtainMethodId(t.pEnv, _pMethodName,"(Ljava/lang/String;)V", _inout_MethodID);
- jstring str = convertwchar_tToJavaString(t.pEnv,_nArgument);
+ jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,_nArgument));
// call method
- t.pEnv->CallVoidMethod( object, _inout_MethodID , str);
- t.pEnv->DeleteLocalRef(str);
+ t.pEnv->CallVoidMethod( object, _inout_MethodID , str.get());
ThrowSQLException( t.pEnv, NULL );
}
// -------------------------------------------------------------------------
@@ -417,10 +416,9 @@ sal_Int32 java_lang_Object::callIntMethodWithStringArg( const char* _pMethodName
// *this
// );
- jstring str = convertwchar_tToJavaString(t.pEnv,_nArgument);
+ jdbc::LocalRef< jstring > str( t.env(),convertwchar_tToJavaString(t.pEnv,_nArgument));
// call method
- jint out = t.pEnv->CallIntMethod( object, _inout_MethodID , str);
- t.pEnv->DeleteLocalRef(str);
+ jint out = t.pEnv->CallIntMethod( object, _inout_MethodID , str.get());
ThrowSQLException( t.pEnv, NULL );
return (sal_Int32)out;
}