From 4c80d22b3614487bbfe4ec80ea277273680f7b87 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 11 Nov 2009 13:27:33 +0100 Subject: #i105086# fix for clob and blob --- connectivity/source/drivers/jdbc/Object.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'connectivity/source/drivers/jdbc/Object.cxx') 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 #include #include - +#include "java/LocalRef.hxx" #include "resource/jdbc_log.hrc" #include #include @@ -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; } -- cgit v1.2.3