diff options
author | Ocke Janssen <oj@openoffice.org> | 2009-02-13 06:02:11 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2009-02-13 06:02:11 +0000 |
commit | a9cb62614633b32b99859e8b86a340a9952ec350 (patch) | |
tree | abc0f89e8eaea8f9389563ae3736a0a882c843e4 | |
parent | bc144a1985f8c38a9a65a1a286ac4b6a65a0c1f6 (diff) |
remove faulty commit on tagooo/DEV300_m41
-rw-r--r-- | connectivity/inc/connectivity/FValue.hxx | 12 | ||||
-rw-r--r-- | connectivity/source/commontools/FValue.cxx | 145 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/DatabaseMetaData.cxx | 75 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Object.cxx | 7 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/ResultSet.cxx | 1169 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/ResultSetMetaData.cxx | 369 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/makefile.mk | 2 | ||||
-rw-r--r-- | connectivity/source/inc/java/lang/Object.hxx | 5 | ||||
-rw-r--r-- | connectivity/source/inc/java/sql/ResultSetMetaData.hxx | 1 |
9 files changed, 624 insertions, 1161 deletions
diff --git a/connectivity/inc/connectivity/FValue.hxx b/connectivity/inc/connectivity/FValue.hxx index 850a024a3b..8dba9e7ee9 100644 --- a/connectivity/inc/connectivity/FValue.hxx +++ b/connectivity/inc/connectivity/FValue.hxx @@ -344,18 +344,6 @@ namespace connectivity sal_Int32 _nType, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow); - /** - fetches a single value out of the row - @param _nPos the current column position - @param _nType the type of the current column - @param _bNullable if true then it will be checked if the result could be NULL, otherwise not. - @param _xRow the row where to fetch the data from - */ - void fill(sal_Int32 _nPos, - sal_Int32 _nType, - sal_Bool _bNullable, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow); - void fill(const ::com::sun::star::uno::Any& _rValue); }; diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 0634d041a6..fc212b1568 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -36,7 +36,6 @@ #include "connectivity/CommonTools.hxx" #include <connectivity/dbconversion.hxx> #include <com/sun/star/io/XInputStream.hpp> -#include <rtl/logfile.hxx> using namespace connectivity; using namespace dbtools; @@ -48,12 +47,10 @@ using namespace ::com::sun::star::io; namespace { static sal_Bool isStorageCompatible(sal_Int32 _eType1, sal_Int32 _eType2) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::isStorageCompatible" ); sal_Bool bIsCompatible = sal_True; if (_eType1 != _eType2) { - RTL_LOGFILE_CONTEXT_TRACE( aLogger, "ORowSetValue::isStorageCompatible _eType1 != _eType2" ); switch (_eType1) { case DataType::CHAR: @@ -199,65 +196,65 @@ namespace tracing // ----------------------------------------------------------------------------- void ORowSetValue::setTypeKind(sal_Int32 _eType) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setTypeKind" ); - if ( !m_bNull && !isStorageCompatible(_eType, m_eTypeKind) ) - { - switch(_eType) + if (!m_bNull) + if (!isStorageCompatible(_eType, m_eTypeKind)) { - case DataType::VARCHAR: - case DataType::CHAR: - case DataType::DECIMAL: - case DataType::NUMERIC: - case DataType::LONGVARCHAR: - (*this) = getString(); - break; - case DataType::BIGINT: - (*this) = getLong(); - break; + switch(_eType) + { + case DataType::VARCHAR: + case DataType::CHAR: + case DataType::DECIMAL: + case DataType::NUMERIC: + case DataType::LONGVARCHAR: + (*this) = getString(); + break; + case DataType::BIGINT: + (*this) = getLong(); + break; - case DataType::FLOAT: - (*this) = getFloat(); - break; - case DataType::DOUBLE: - case DataType::REAL: - (*this) = getDouble(); - break; - case DataType::TINYINT: - (*this) = getInt8(); - break; - case DataType::SMALLINT: - (*this) = getInt16(); - break; - case DataType::INTEGER: - (*this) = getInt32(); - break; - case DataType::BIT: - case DataType::BOOLEAN: - (*this) = getBool(); - break; - case DataType::DATE: - (*this) = getDate(); - break; - case DataType::TIME: - (*this) = getTime(); - break; - case DataType::TIMESTAMP: - (*this) = getDateTime(); - break; - case DataType::BINARY: - case DataType::VARBINARY: - case DataType::LONGVARBINARY: - (*this) = getSequence(); - break; - case DataType::BLOB: - case DataType::CLOB: - case DataType::OBJECT: - (*this) = getAny(); - break; - default: - OSL_ENSURE(0,"ORowSetValue:operator==(): UNSPUPPORTED TYPE!"); + case DataType::FLOAT: + (*this) = getFloat(); + break; + case DataType::DOUBLE: + case DataType::REAL: + (*this) = getDouble(); + break; + case DataType::TINYINT: + (*this) = getInt8(); + break; + case DataType::SMALLINT: + (*this) = getInt16(); + break; + case DataType::INTEGER: + (*this) = getInt32(); + break; + case DataType::BIT: + case DataType::BOOLEAN: + (*this) = getBool(); + break; + case DataType::DATE: + (*this) = getDate(); + break; + case DataType::TIME: + (*this) = getTime(); + break; + case DataType::TIMESTAMP: + (*this) = getDateTime(); + break; + case DataType::BINARY: + case DataType::VARBINARY: + case DataType::LONGVARBINARY: + (*this) = getSequence(); + break; + case DataType::BLOB: + case DataType::CLOB: + case DataType::OBJECT: + (*this) = getAny(); + break; + default: + OSL_ENSURE(0,"ORowSetValue:operator==(): UNSPUPPORTED TYPE!"); + } } - } m_eTypeKind = _eType; } @@ -265,7 +262,6 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType) // ----------------------------------------------------------------------------- void ORowSetValue::free() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::free" ); if(!m_bNull) { switch(m_eTypeKind) @@ -352,7 +348,7 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH) if(&_rRH == this) return *this; - if ( m_eTypeKind != _rRH.m_eTypeKind || (_rRH.m_bNull && !m_bNull) || m_bSigned != _rRH.m_bSigned) + if ( m_eTypeKind != _rRH.m_eTypeKind || _rRH.m_bNull || m_bSigned != _rRH.m_bSigned) free(); m_bBound = _rRH.m_bBound; @@ -852,7 +848,6 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const // ------------------------------------------------------------------------- Any ORowSetValue::makeAny() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::makeAny" ); Any rValue; if(isBound() && !isNull()) { @@ -944,7 +939,6 @@ Any ORowSetValue::makeAny() const // ------------------------------------------------------------------------- ::rtl::OUString ORowSetValue::getString( ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getString" ); ::rtl::OUString aRet; if(!m_bNull) { @@ -1020,7 +1014,6 @@ Any ORowSetValue::makeAny() const // ------------------------------------------------------------------------- sal_Bool ORowSetValue::getBool() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getBool" ); sal_Bool bRet = sal_False; if(!m_bNull) { @@ -1091,7 +1084,6 @@ sal_Bool ORowSetValue::getBool() const // ------------------------------------------------------------------------- sal_Int8 ORowSetValue::getInt8() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getInt8" ); sal_Int8 nRet = 0; @@ -1156,7 +1148,6 @@ sal_Int8 ORowSetValue::getInt8() const // ------------------------------------------------------------------------- sal_Int16 ORowSetValue::getInt16() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getInt16" ); sal_Int16 nRet = 0; @@ -1221,7 +1212,6 @@ sal_Int16 ORowSetValue::getInt16() const // ------------------------------------------------------------------------- sal_Int32 ORowSetValue::getInt32() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getInt32" ); sal_Int32 nRet = 0; if(!m_bNull) { @@ -1286,7 +1276,6 @@ sal_Int32 ORowSetValue::getInt32() const // ------------------------------------------------------------------------- sal_Int64 ORowSetValue::getLong() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getLong" ); sal_Int64 nRet = 0; if(!m_bNull) { @@ -1351,7 +1340,6 @@ sal_Int64 ORowSetValue::getLong() const // ------------------------------------------------------------------------- float ORowSetValue::getFloat() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getFloat" ); float nRet = 0; if(!m_bNull) { @@ -1420,7 +1408,6 @@ float ORowSetValue::getFloat() const // ------------------------------------------------------------------------- double ORowSetValue::getDouble() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDouble" ); double nRet = 0; @@ -1491,7 +1478,6 @@ double ORowSetValue::getDouble() const // ------------------------------------------------------------------------- void ORowSetValue::setFromDouble(const double& _rVal,sal_Int32 _nDatatype) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setFromDouble" ); free(); m_bNull = sal_False; @@ -1578,7 +1564,6 @@ void ORowSetValue::setFromDouble(const double& _rVal,sal_Int32 _nDatatype) // ----------------------------------------------------------------------------- Sequence<sal_Int8> ORowSetValue::getSequence() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getSequence" ); Sequence<sal_Int8> aSeq; if (!m_bNull) { @@ -1620,7 +1605,6 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const // ----------------------------------------------------------------------------- ::com::sun::star::util::Date ORowSetValue::getDate() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDate" ); ::com::sun::star::util::Date aValue; if(!m_bNull) { @@ -1659,7 +1643,6 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const // ----------------------------------------------------------------------------- ::com::sun::star::util::Time ORowSetValue::getTime() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getTime" ); ::com::sun::star::util::Time aValue; if(!m_bNull) { @@ -1697,7 +1680,6 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const // ----------------------------------------------------------------------------- ::com::sun::star::util::DateTime ORowSetValue::getDateTime() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDateTime" ); ::com::sun::star::util::DateTime aValue; if(!m_bNull) { @@ -1744,7 +1726,6 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const // ----------------------------------------------------------------------------- void ORowSetValue::setSigned(sal_Bool _bMod) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setSigned" ); if ( m_bSigned != _bMod ) { m_bSigned = _bMod; @@ -1811,15 +1792,6 @@ void ORowSetValue::fill(sal_Int32 _nPos, sal_Int32 _nType, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill" ); - fill(_nPos,_nType,sal_True,_xRow); -} -void ORowSetValue::fill(sal_Int32 _nPos, - sal_Int32 _nType, - sal_Bool _bNullable, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill" ); sal_Bool bReadData = sal_True; switch(_nType) { @@ -1891,14 +1863,13 @@ void ORowSetValue::fill(sal_Int32 _nPos, bReadData = sal_False; break; } - if ( bReadData && _bNullable && _xRow->wasNull() ) + if ( bReadData && _xRow->wasNull() ) setNull(); setTypeKind(_nType); } // ----------------------------------------------------------------------------- void ORowSetValue::fill(const Any& _rValue) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill" ); switch (_rValue.getValueType().getTypeClass()) { case TypeClass_VOID: diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index eded040365..6786ef0994 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -142,7 +142,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // Java-Call absetzen static jmethodID mID = NULL; @@ -351,7 +351,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getIndexInfo( jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // Java-Call absetzen static jmethodID mID = NULL; @@ -395,7 +395,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getBestRowIdentifier jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // Java-Call absetzen static jmethodID mID = NULL; @@ -515,7 +515,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference( jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // Java-Call absetzen static jmethodID mID = NULL; @@ -565,18 +565,15 @@ sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethod SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callBooleanMethod: no Java enviroment anymore!" ); - + if ( t.pEnv ) { // obtain method ID if ( !_inout_MethodID ) - { _inout_MethodID = t.pEnv->GetMethodID( getMyClass(), _pMethodName, "()Z" ); - OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callBooleanMethod:: unknown method id!" ); - if ( !_inout_MethodID ) - throw SQLException(); - } // if ( !_inout_MethodID ) + OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callBooleanMethod:: unknown method id!" ); // call method + if ( _inout_MethodID ) { out = t.pEnv->CallBooleanMethod( object, _inout_MethodID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -596,18 +593,15 @@ sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethod SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callStringMethod: no Java enviroment anymore!" ); - + if( t.pEnv ) { // obtain method ID if ( !_inout_MethodID ) - { _inout_MethodID = t.pEnv->GetMethodID( getMyClass(), _pMethodName, "()Ljava/lang/String;" ); - OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callStringMethod: unknown method id!" ); - if ( !_inout_MethodID ) - throw SQLException(); - } + OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callStringMethod: unknown method id!" ); + // call method - + if ( _inout_MethodID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, _inout_MethodID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -635,19 +629,15 @@ sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod( const char* _pMethodNam SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callIntMethod: no Java enviroment anymore!" ); - + if( t.pEnv ) { // obtain method ID if ( !_inout_MethodID ) - { _inout_MethodID = t.pEnv->GetMethodID( getMyClass(), _pMethodName, "()I" ); - OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callIntMethod: unknown method id!" ); - if ( !_inout_MethodID ) - throw SQLException(); - } + OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callIntMethod: unknown method id!" ); // call method - + if ( _inout_MethodID ) { out = t.pEnv->CallIntMethod( object, _inout_MethodID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -666,18 +656,15 @@ sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char jboolean out( sal_False ); SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg: no Java enviroment anymore!" ); - + if ( t.pEnv ) { // obtain method ID if ( !_inout_MethodID ) - { _inout_MethodID = t.pEnv->GetMethodID( getMyClass(), _pMethodName, "(I)Z" ); - OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg: unknown method id!" ); - if ( !_inout_MethodID ) - throw SQLException(); - } + OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg: unknown method id!" ); + // call method - + if ( _inout_MethodID ) { out = t.pEnv->CallBooleanMethod( object, _inout_MethodID, _nArgument ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -697,19 +684,15 @@ Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethod( con SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callResultSetMethod: no Java enviroment anymore!" ); - + if ( t.pEnv ) { // obtain method ID if ( !_inout_MethodID ) - { _inout_MethodID = t.pEnv->GetMethodID( getMyClass(), _pMethodName, "()Ljava/sql/ResultSet;" ); - OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callResultSetMethod: unknown method id!" ); - if ( !_inout_MethodID ) - throw SQLException(); - } + OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callResultSetMethod: unknown method id!" ); // call method - + if ( _inout_MethodID ) { out = t.pEnv->CallObjectMethod( object, _inout_MethodID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -748,22 +731,18 @@ Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethodWithS SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: no Java enviroment anymore!" ); - + if ( t.pEnv ) { const char* pSignature = _pOptionalAdditionalString ? "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;" : "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;"; // obtain method ID if ( !_inout_MethodID ) - { _inout_MethodID = t.pEnv->GetMethodID( getMyClass(), _pMethodName, pSignature ); - OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: unknown method id!" ); - if ( !_inout_MethodID ) - throw SQLException(); - } + OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: unknown method id!" ); // call method - + if ( _inout_MethodID ) { jvalue args[4]; // convert parameters @@ -1126,7 +1105,7 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType jboolean out( sal_False ); SDBThreadAttach t; - + if ( t.pEnv ) { static jmethodID mID = NULL; if ( !mID ) @@ -1474,7 +1453,7 @@ sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_I jboolean out( sal_False ); SDBThreadAttach t; - + if ( t.pEnv ) { static jmethodID mID = NULL; if ( !mID ) @@ -1558,7 +1537,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getUDTs( { jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I;)Ljava/sql/ResultSet;"; diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 8b6e6d3ffc..b5251960a4 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -45,7 +45,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include "resource/jdbc_log.hrc" -#include <rtl/logfile.hxx> + #include <comphelper/logging.hxx> #include <memory> @@ -81,32 +81,27 @@ SDBThreadAttach::SDBThreadAttach() : m_aGuard(java_lang_Object::getVM()) , pEnv(NULL) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "SDBThreadAttach::SDBThreadAttach" ); pEnv = m_aGuard.getEnvironment(); OSL_ENSURE(pEnv,"Environment is nULL!"); } // ----------------------------------------------------------------------------- SDBThreadAttach::~SDBThreadAttach() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "SDBThreadAttach::~SDBThreadAttach" ); } // ----------------------------------------------------------------------------- oslInterlockedCount& getJavaVMRefCount() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "getJavaVMRefCount" ); static oslInterlockedCount s_nRefCount = 0; return s_nRefCount; } // ----------------------------------------------------------------------------- void SDBThreadAttach::addRef() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "SDBThreadAttach::addRef" ); osl_incrementInterlockedCount(&getJavaVMRefCount()); } // ----------------------------------------------------------------------------- void SDBThreadAttach::releaseRef() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "SDBThreadAttach::releaseRef" ); osl_decrementInterlockedCount(&getJavaVMRefCount()); if ( getJavaVMRefCount() == 0 ) { diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx index ea0b8b5c4c..ba0f070245 100644 --- a/connectivity/source/drivers/jdbc/ResultSet.cxx +++ b/connectivity/source/drivers/jdbc/ResultSet.cxx @@ -85,7 +85,6 @@ java_sql_ResultSet::java_sql_ResultSet( JNIEnv * pEnv, jobject myObj, const java osl_incrementInterlockedCount(&m_refCount); if ( pStmt ) m_xStatement = *pStmt; - osl_decrementInterlockedCount(&m_refCount); } // ----------------------------------------------------------------------------- @@ -134,24 +133,19 @@ void java_sql_ResultSet::disposing(void) if( object ) { SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "close"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "close"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID clearObject(*t.pEnv); } } //t.pEnv @@ -182,21 +176,16 @@ sal_Int32 SAL_CALL java_sql_ResultSet::findColumn( const ::rtl::OUString& column RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::findColumn" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(Ljava/lang/String;)I"; + static const char * cMethodName = "findColumn"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(Ljava/lang/String;)I"; - static const char * cMethodName = "findColumn"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ // Parameter konvertieren jstring str = convertwchar_tToJavaString(t.pEnv,columnName); out = t.pEnv->CallIntMethod( object, mID, str ); @@ -204,7 +193,7 @@ sal_Int32 SAL_CALL java_sql_ResultSet::findColumn( const ::rtl::OUString& column t.pEnv->DeleteLocalRef(str); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -216,25 +205,20 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_ResultSet::get RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBinaryStream" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/io/InputStream;"; + static const char * cMethodName = "getBinaryStream"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/io/InputStream;"; - static const char * cMethodName = "getBinaryStream"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? 0 : new java_io_InputStream( t.pEnv, out ); @@ -245,25 +229,20 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_ResultSet::get RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getCharacterStream" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/io/InputStream;"; + static const char * cMethodName = "getCharacterStream"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/io/InputStream;"; - static const char * cMethodName = "getCharacterStream"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? 0 : new java_io_InputStream( t.pEnv, out ); @@ -275,25 +254,20 @@ sal_Bool SAL_CALL java_sql_ResultSet::getBoolean( sal_Int32 columnIndex ) throw( RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBoolean" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "getBoolean"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "getBoolean"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID, columnIndex ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return out; } @@ -304,25 +278,20 @@ sal_Int8 SAL_CALL java_sql_ResultSet::getByte( sal_Int32 columnIndex ) throw(SQL RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getByte" ); jbyte out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)B"; + static const char * cMethodName = "getByte"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)B"; - static const char * cMethodName = "getByte"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallByteMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return out; } @@ -333,20 +302,15 @@ Sequence< sal_Int8 > SAL_CALL java_sql_ResultSet::getBytes( sal_Int32 columnInde RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBytes" ); Sequence< sal_Int8 > aSeq; SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { + static const char * cSignature = "(I)[B"; + static const char * cMethodName = "getBytes"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)[B"; - static const char * cMethodName = "getBytes"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ jbyteArray out = (jbyteArray)t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); if (out) @@ -357,7 +321,7 @@ Sequence< sal_Int8 > SAL_CALL java_sql_ResultSet::getBytes( sal_Int32 columnInde t.pEnv->DeleteLocalRef(out); } // und aufraeumen - + } //mID } //t.pEnv return aSeq; } @@ -368,25 +332,20 @@ Sequence< sal_Int8 > SAL_CALL java_sql_ResultSet::getBytes( sal_Int32 columnInde RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getDate" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Date;"; + static const char * cMethodName = "getDate"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Date;"; - static const char * cMethodName = "getDate"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out ? static_cast <com::sun::star::util::Date> (java_sql_Date( t.pEnv, out )) : ::com::sun::star::util::Date(); @@ -398,25 +357,20 @@ double SAL_CALL java_sql_ResultSet::getDouble( sal_Int32 columnIndex ) throw(SQL RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getDouble" ); jdouble out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)D"; + static const char * cMethodName = "getDouble"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)D"; - static const char * cMethodName = "getDouble"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallDoubleMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return out; } @@ -427,25 +381,20 @@ float SAL_CALL java_sql_ResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLEx RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFloat" ); jfloat out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)F"; + static const char * cMethodName = "getFloat"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)F"; - static const char * cMethodName = "getFloat"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallFloatMethod( object, mID, columnIndex ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return out; } @@ -456,25 +405,20 @@ sal_Int32 SAL_CALL java_sql_ResultSet::getInt( sal_Int32 columnIndex ) throw(SQL RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getInt" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)I"; + static const char * cMethodName = "getInt"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)I"; - static const char * cMethodName = "getInt"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID, columnIndex ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -485,24 +429,19 @@ sal_Int32 SAL_CALL java_sql_ResultSet::getRow( ) throw(SQLException, RuntimeExc RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getRow" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "()I"; + static const char * cMethodName = "getRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()I"; - static const char * cMethodName = "getRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -513,24 +452,19 @@ sal_Int64 SAL_CALL java_sql_ResultSet::getLong( sal_Int32 columnIndex ) throw(SQ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getLong" ); jlong out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)J"; + static const char * cMethodName = "getLong"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)J"; - static const char * cMethodName = "getLong"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallLongMethod( object, mID, columnIndex ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return out; } @@ -541,24 +475,20 @@ sal_Int64 SAL_CALL java_sql_ResultSet::getLong( sal_Int32 columnIndex ) throw(SQ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getMetaData" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Ljava/sql/ResultSetMetaData;"; + static const char * cMethodName = "getMetaData"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Ljava/sql/ResultSetMetaData;"; - static const char * cMethodName = "getMetaData"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ + out = t.pEnv->CallObjectMethod( object, mID ); + ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); } - - out = t.pEnv->CallObjectMethod( object, mID ); - ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); } return out==0 ? 0 : new java_sql_ResultSetMetaData( t.pEnv, out, m_aLogger,*m_pConnection ); @@ -569,24 +499,19 @@ Reference< XArray > SAL_CALL java_sql_ResultSet::getArray( sal_Int32 columnIndex RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getArray" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Array;"; + static const char * cMethodName = "getArray"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Array;"; - static const char * cMethodName = "getArray"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? 0 : new java_sql_Array( t.pEnv, out ); @@ -598,24 +523,19 @@ Reference< XClob > SAL_CALL java_sql_ResultSet::getClob( sal_Int32 columnIndex ) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getClob" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Clob;"; + static const char * cMethodName = "getClob"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Clob;"; - static const char * cMethodName = "getClob"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? 0 : new java_sql_Clob( t.pEnv, out ); @@ -626,24 +546,19 @@ Reference< XBlob > SAL_CALL java_sql_ResultSet::getBlob( sal_Int32 columnIndex ) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getBlob" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Blob;"; + static const char * cMethodName = "getBlob"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Blob;"; - static const char * cMethodName = "getBlob"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? 0 : new java_sql_Blob( t.pEnv, out ); @@ -655,24 +570,19 @@ Reference< XRef > SAL_CALL java_sql_ResultSet::getRef( sal_Int32 columnIndex ) t RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getRef" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Ref;"; + static const char * cMethodName = "getRef"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Ref;"; - static const char * cMethodName = "getRef"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? 0 : new java_sql_Ref( t.pEnv, out ); @@ -684,29 +594,24 @@ Any SAL_CALL java_sql_ResultSet::getObject( sal_Int32 columnIndex, const Referen RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getObject" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ jvalue args[2]; // Parameter konvertieren args[0].i = (sal_Int32)columnIndex; args[1].l = convertTypeMapToJavaMap(t.pEnv,typeMap); // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/Object;"; + static const char * cMethodName = "getObject"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/Object;"; - static const char * cMethodName = "getObject"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethodA( object, mID, args); t.pEnv->DeleteLocalRef((jstring)args[1].l); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out==0 ? Any() : Any();//new java_lang_Object( t.pEnv, out ); @@ -718,24 +623,19 @@ sal_Int16 SAL_CALL java_sql_ResultSet::getShort( sal_Int32 columnIndex ) throw(S RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getShort" ); jshort out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)S"; + static const char * cMethodName = "getShort"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)S"; - static const char * cMethodName = "getShort"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallShortMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv return (sal_Int16)out; } @@ -747,22 +647,20 @@ sal_Int16 SAL_CALL java_sql_ResultSet::getShort( sal_Int32 columnIndex ) throw(S RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getString" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getString"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getString"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature ); - if ( !mID ) - throw SQLException(); - } - jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, columnIndex ); - ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - aStr = JavaString2String(t.pEnv,out); + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ + jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, columnIndex ); + ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + aStr = JavaString2String(t.pEnv,out); + // und aufraeumen + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return aStr; @@ -775,25 +673,20 @@ sal_Int16 SAL_CALL java_sql_ResultSet::getShort( sal_Int32 columnIndex ) throw(S RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getTime" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Time;"; + static const char * cMethodName = "getTime"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Time;"; - static const char * cMethodName = "getTime"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out ? static_cast <com::sun::star::util::Time> (java_sql_Time( t.pEnv, out )) : ::com::sun::star::util::Time(); @@ -806,24 +699,19 @@ sal_Int16 SAL_CALL java_sql_ResultSet::getShort( sal_Int32 columnIndex ) throw(S RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getTimestamp" ); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/sql/Timestamp;"; + static const char * cMethodName = "getTimestamp"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/sql/Timestamp;"; - static const char * cMethodName = "getTimestamp"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID, columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! return out ? static_cast <com::sun::star::util::DateTime> (java_sql_Timestamp( t.pEnv, out )) : ::com::sun::star::util::DateTime(); @@ -835,25 +723,20 @@ sal_Bool SAL_CALL java_sql_ResultSet::isAfterLast( ) throw(SQLException, Runtim RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isAfterLast" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "isAfterLast"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "isAfterLast"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -863,25 +746,20 @@ sal_Bool SAL_CALL java_sql_ResultSet::isFirst( ) throw(SQLException, RuntimeExc RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isFirst" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "isFirst"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "isFirst"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -891,25 +769,20 @@ sal_Bool SAL_CALL java_sql_ResultSet::isLast( ) throw(SQLException, RuntimeExce RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isLast" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "isLast"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "isLast"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -918,25 +791,20 @@ void SAL_CALL java_sql_ResultSet::beforeFirst( ) throw(SQLException, RuntimeExc { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::beforeFirst" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "isBeforeFirst"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "isBeforeFirst"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv } // ------------------------------------------------------------------------- @@ -944,25 +812,20 @@ void SAL_CALL java_sql_ResultSet::afterLast( ) throw(SQLException, RuntimeExcep { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::afterLast" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "afterLast"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "afterLast"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv } // ------------------------------------------------------------------------- @@ -979,24 +842,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::first( ) throw(SQLException, RuntimeExcep RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::first" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "first"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "first"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1007,24 +865,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::last( ) throw(SQLException, RuntimeExcept RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::last" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "last"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "last"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1034,24 +887,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::absolute( sal_Int32 row ) throw(SQLExcepti RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::absolute" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "absolute"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "absolute"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID,row); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1061,24 +909,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::relative( sal_Int32 row ) throw(SQLExcepti RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::relative" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "relative"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "relative"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID,row); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1088,25 +931,20 @@ sal_Bool SAL_CALL java_sql_ResultSet::previous( ) throw(SQLException, RuntimeEx RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::previous" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "previous"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "previous"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1123,24 +961,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::rowDeleted( ) throw(SQLException, Runtime RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::rowDeleted" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "rowDeleted"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "rowDeleted"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1150,24 +983,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::rowInserted( ) throw(SQLException, Runtim RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::rowInserted" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "rowInserted"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "rowInserted"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1177,24 +1005,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::rowUpdated( ) throw(SQLException, Runtime RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::rowUpdated" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "rowUpdated"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "rowUpdated"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1205,24 +1028,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::isBeforeFirst( ) throw(SQLException, Runt RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::isBeforeFirst" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "isBeforeFirst"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "isBeforeFirst"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1233,25 +1051,20 @@ sal_Bool SAL_CALL java_sql_ResultSet::next( ) throw(SQLException, RuntimeExcept RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::next" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "next"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "next"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1262,24 +1075,19 @@ sal_Bool SAL_CALL java_sql_ResultSet::wasNull( ) throw(SQLException, RuntimeExc RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::wasNull" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Z"; + static const char * cMethodName = "wasNull"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Z"; - static const char * cMethodName = "wasNull"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv return out; } @@ -1289,24 +1097,19 @@ void SAL_CALL java_sql_ResultSet::cancel( ) throw(::com::sun::star::uno::Runtim { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::cancel" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "cancel"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "cancel"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv } // ------------------------------------------------------------------------- @@ -1315,23 +1118,19 @@ void SAL_CALL java_sql_ResultSet::clearWarnings( ) throw(::com::sun::star::sdbc { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::clearWarnings" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "clearWarnings"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "clearWarnings"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1340,24 +1139,19 @@ void SAL_CALL java_sql_ResultSet::clearWarnings( ) throw(::com::sun::star::sdbc RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getWarnings" ); jobject out(NULL); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Ljava/sql/SQLWarning;"; + static const char * cMethodName = "getWarnings"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Ljava/sql/SQLWarning;"; - static const char * cMethodName = "getWarnings"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallObjectMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! if( out ) @@ -1376,23 +1170,19 @@ void SAL_CALL java_sql_ResultSet::insertRow( ) throw(::com::sun::star::sdbc::SQ { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::insertRow" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "insertRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "insertRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1400,23 +1190,19 @@ void SAL_CALL java_sql_ResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQ { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateRow" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "updateRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "updateRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1424,23 +1210,19 @@ void SAL_CALL java_sql_ResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQ { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::deleteRow" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "deleteRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "deleteRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1449,23 +1231,19 @@ void SAL_CALL java_sql_ResultSet::cancelRowUpdates( ) throw(::com::sun::star::s { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::cancelRowUpdates" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "cancelRowUpdates"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "cancelRowUpdates"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1474,23 +1252,19 @@ void SAL_CALL java_sql_ResultSet::moveToInsertRow( ) throw(::com::sun::star::sd { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::moveToInsertRow" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "moveToInsertRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "moveToInsertRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1499,23 +1273,19 @@ void SAL_CALL java_sql_ResultSet::moveToCurrentRow( ) throw(::com::sun::star::s { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::moveToCurrentRow" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "moveToCurrentRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "moveToCurrentRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1524,23 +1294,19 @@ void SAL_CALL java_sql_ResultSet::updateNull( sal_Int32 columnIndex ) throw(::co { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateNull" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I)V"; + static const char * cMethodName = "updateNull"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)V"; - static const char * cMethodName = "updateNull"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1549,23 +1315,19 @@ void SAL_CALL java_sql_ResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateBoolean" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(IZ)V"; + static const char * cMethodName = "updateBoolean"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(IZ)V"; - static const char * cMethodName = "updateBoolean"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1573,23 +1335,19 @@ void SAL_CALL java_sql_ResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateByte" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(IB)V"; + static const char * cMethodName = "updateByte"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(IB)V"; - static const char * cMethodName = "updateByte"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1598,23 +1356,19 @@ void SAL_CALL java_sql_ResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateShort" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(IS)V"; + static const char * cMethodName = "updateShort"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(IS)V"; - static const char * cMethodName = "updateShort"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1622,23 +1376,19 @@ void SAL_CALL java_sql_ResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateInt" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(II)V"; + static const char * cMethodName = "updateInt"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(II)V"; - static const char * cMethodName = "updateInt"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1646,23 +1396,19 @@ void SAL_CALL java_sql_ResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateLong" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(IJ)V"; + static const char * cMethodName = "updateLong"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(IJ)V"; - static const char * cMethodName = "updateLong"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1672,23 +1418,19 @@ void SAL_CALL java_sql_ResultSet::updateFloat( sal_Int32 columnIndex, float x ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateFloat" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(IF)V"; + static const char * cMethodName = "updateFloat"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(IF)V"; - static const char * cMethodName = "updateFloat"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1697,23 +1439,19 @@ void SAL_CALL java_sql_ResultSet::updateDouble( sal_Int32 columnIndex, double x { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateDouble" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(ID)V"; + static const char * cMethodName = "updateDouble"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(ID)V"; - static const char * cMethodName = "updateDouble"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,columnIndex,x); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } } } // ------------------------------------------------------------------------- @@ -1722,22 +1460,17 @@ void SAL_CALL java_sql_ResultSet::updateString( sal_Int32 columnIndex, const ::r { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateString" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(ILjava/lang/String;)V"; + static const char * cMethodName = "updateString"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(ILjava/lang/String;)V"; - static const char * cMethodName = "updateString"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { // Parameter konvertieren jstring str = convertwchar_tToJavaString(t.pEnv,x); @@ -1753,21 +1486,16 @@ void SAL_CALL java_sql_ResultSet::updateBytes( sal_Int32 columnIndex, const ::co { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateBytes" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I[B)V"; + static const char * cMethodName = "updateBytes"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I[B)V"; - static const char * cMethodName = "updateBytes"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jbyteArray aArray = t.pEnv->NewByteArray(x.getLength()); t.pEnv->SetByteArrayRegion(aArray,0,x.getLength(),(jbyte*)x.getConstArray()); @@ -1784,22 +1512,17 @@ void SAL_CALL java_sql_ResultSet::updateDate( sal_Int32 columnIndex, const ::com { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateDate" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(ILjava/sql/Date;)V"; + static const char * cMethodName = "updateDate"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(ILjava/sql/Date;)V"; - static const char * cMethodName = "updateDate"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jvalue args[1]; // Parameter konvertieren @@ -1816,21 +1539,16 @@ void SAL_CALL java_sql_ResultSet::updateTime( sal_Int32 columnIndex, const ::com { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateTime" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(ILjava/sql/Time;)V"; + static const char * cMethodName = "updateTime"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(ILjava/sql/Time;)V"; - static const char * cMethodName = "updateTime"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jvalue args[1]; // Parameter konvertieren @@ -1847,21 +1565,16 @@ void SAL_CALL java_sql_ResultSet::updateTimestamp( sal_Int32 columnIndex, const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::updateTimestamp" ); SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(I;Ljava/sql/Timestamp;)V"; + static const char * cMethodName = "updateTimestamp"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I;Ljava/sql/Timestamp;)V"; - static const char * cMethodName = "updateTimestamp"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jvalue args[1]; java_sql_Timestamp aD(x); @@ -1908,22 +1621,17 @@ void SAL_CALL java_sql_ResultSet::updateNumericObject( sal_Int32 columnIndex, co try { SDBThreadAttach t; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "(ILjava/lang/Object;I)V"; + static const char * cMethodName = "updateObject"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(ILjava/lang/Object;I)V"; - static const char * cMethodName = "updateObject"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { // Parameter konvertieren double nTemp = 0.0; @@ -1951,25 +1659,20 @@ sal_Int32 java_sql_ResultSet::getResultSetConcurrency() const throw(::com::sun:: RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getResultSetConcurrency" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "()I"; + static const char * cMethodName = "getConcurrency"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()I"; - static const char * cMethodName = "getConcurrency"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID); // special case here most JDBC 1.x doesn't support this feature so we just clear the exception when they occured isExceptionOccured(t.pEnv,sal_True); - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -1980,25 +1683,20 @@ sal_Int32 java_sql_ResultSet::getResultSetType() const throw(::com::sun::star::s RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getResultSetType" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "()I"; + static const char * cMethodName = "getType"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()I"; - static const char * cMethodName = "getType"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID); // special case here most JDBC 1.x doesn't support this feature so we just clear the exception when they occured isExceptionOccured(t.pEnv,sal_True); - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -2008,25 +1706,20 @@ sal_Int32 java_sql_ResultSet::getFetchDirection() const throw(::com::sun::star:: RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFetchDirection" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "()I"; + static const char * cMethodName = "getFetchDirection"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()I"; - static const char * cMethodName = "getFetchDirection"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID); // special case here most JDBC 1.x doesn't support this feature so we just clear the exception when they occured isExceptionOccured(t.pEnv,sal_True); - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -2036,25 +1729,20 @@ sal_Int32 java_sql_ResultSet::getFetchSize() const throw(::com::sun::star::sdbc: RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getFetchSize" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "()I"; + static const char * cMethodName = "getFetchSize"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()I"; - static const char * cMethodName = "getFetchSize"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID); // special case here most JDBC 1.x doesn't support this feature so we just clear the exception when they occured isExceptionOccured(t.pEnv,sal_True); - + } //mID } //t.pEnv return (sal_Int32)out; } @@ -2064,24 +1752,20 @@ sal_Int32 java_sql_ResultSet::getFetchSize() const throw(::com::sun::star::sdbc: RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::getCursorName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()Ljava/lang/String;"; + static const char * cMethodName = "getCursorName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()Ljava/lang/String;"; - static const char * cMethodName = "getCursorName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *const_cast< java_sql_ResultSet* >( this ) ); aStr = JavaString2String(t.pEnv,out); + } } return aStr; @@ -2092,25 +1776,20 @@ void java_sql_ResultSet::setFetchDirection(sal_Int32 _par0) throw(::com::sun::st { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::setFetchDirection" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)V"; + static const char * cMethodName = "setFetchDirection"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)V"; - static const char * cMethodName = "setFetchDirection"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,_par0); // special case here most JDBC 1.x doesn't support this feature so we just clear the exception when they occured isExceptionOccured(t.pEnv,sal_True); - + } //mID } //t.pEnv } @@ -2119,24 +1798,19 @@ void SAL_CALL java_sql_ResultSet::refreshRow( ) throw(SQLException, RuntimeExce { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::refreshRow" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - + if( t.pEnv ) { // temporaere Variable initialisieren + static const char * cSignature = "()V"; + static const char * cMethodName = "refreshRow"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "()V"; - static const char * cMethodName = "refreshRow"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - + } //mID } //t.pEnv } //------------------------------------------------------------------------------ @@ -2144,24 +1818,19 @@ void java_sql_ResultSet::setFetchSize(sal_Int32 _par0) throw(::com::sun::star::s { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSet::setFetchSize" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)V"; + static const char * cMethodName = "setFetchSize"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)V"; - static const char * cMethodName = "setFetchSize"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ t.pEnv->CallVoidMethod( object, mID,_par0); // special case here most JDBC 1.x doesn't support this feature so we just clear the exception when they occured isExceptionOccured(t.pEnv,sal_True); - + } //mID } //t.pEnv } diff --git a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx index ef3d35b8a5..b5b307660c 100644 --- a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx +++ b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx @@ -33,8 +33,6 @@ #include "java/sql/ResultSetMetaData.hxx" #include "java/sql/Connection.hxx" #include "java/tools.hxx" -#include <rtl/logfile.hxx> - using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -42,8 +40,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; - -#define NULLABLE_UNDEFINED 99 //************************************************************** //************ Class: java.sql.ResultSetMetaData //************************************************************** @@ -53,9 +49,7 @@ java_sql_ResultSetMetaData::java_sql_ResultSetMetaData( JNIEnv * pEnv, jobject m :java_lang_Object( pEnv, myObj ) ,m_aLogger( _rResultSetLogger ) ,m_pConnection( &_rCon ) - ,m_nColumnCount(-1) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::java_sql_ResultSetMetaData" ); SDBThreadAttach::addRef(); } java_sql_ResultSetMetaData::~java_sql_ResultSetMetaData() @@ -65,7 +59,6 @@ java_sql_ResultSetMetaData::~java_sql_ResultSetMetaData() jclass java_sql_ResultSetMetaData::getMyClass() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getMyClass" ); // die Klasse muss nur einmal geholt werden, daher statisch if( !theClass ){ SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -81,7 +74,6 @@ jclass java_sql_ResultSetMetaData::getMyClass() void java_sql_ResultSetMetaData::saveClassRef( jclass pClass ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::saveClassRef" ); if( pClass==0 ) return; // der uebergebe Klassen-Handle ist schon global, daher einfach speichern @@ -91,24 +83,18 @@ void java_sql_ResultSetMetaData::saveClassRef( jclass pClass ) sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnDisplaySize" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)I"; + static const char * cMethodName = "getColumnDisplaySize"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)I"; - static const char * cMethodName = "getColumnDisplaySize"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID,column); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); } //mID @@ -119,24 +105,18 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnDisplaySize( sal_Int32 c sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnType" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)I"; + static const char * cMethodName = "getColumnType"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)I"; - static const char * cMethodName = "getColumnType"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID,column); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); } //mID @@ -147,54 +127,39 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnType( sal_Int32 column ) sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnCount" ); - if ( m_nColumnCount == -1 ) - { - SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { - - // temporaere Variable initialisieren - // Java-Call absetzen - static jmethodID mID = NULL; - if ( !mID ) - { - static const char * cSignature = "()I"; - static const char * cMethodName = "getColumnCount"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { - m_nColumnCount = t.pEnv->CallIntMethod( object, mID); - ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); - } //mID - } //t.pEnv - } // if ( m_nColumnCount == -1 ) - return m_nColumnCount; + jint out(0); + SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); + if( t.pEnv ){ + // temporaere Variable initialisieren + static const char * cSignature = "()I"; + static const char * cMethodName = "getColumnCount"; + // Java-Call absetzen + static jmethodID mID = NULL; + if ( !mID ) + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ + out = t.pEnv->CallIntMethod( object, mID); + ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); + } //mID + } //t.pEnv + return (sal_Int32)out; } // ------------------------------------------------------------------------- sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isCaseSensitive" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isCaseSensitive"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isCaseSensitive"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) out = t.pEnv->CallBooleanMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -204,23 +169,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getSchemaName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getSchemaName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getSchemaName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -235,23 +194,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getColumnName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getColumnName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -265,23 +218,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getTableName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getTableName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getTableName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -295,23 +242,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getCatalogName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getCatalogName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getCatalogName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -325,23 +266,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnTypeName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getColumnTypeName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getColumnTypeName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -355,23 +290,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnLabel" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getColumnLabel"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getColumnLabel"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -385,23 +314,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL java_sql_ResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getColumnServiceName" ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Ljava/lang/String;"; + static const char * cMethodName = "getColumnClassName"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Ljava/lang/String;"; - static const char * cMethodName = "getColumnClassName"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -416,25 +339,19 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isCurrency" ); if ( m_pConnection->isIgnoreCurrencyEnabled() ) return sal_False; jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isCurrency"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isCurrency"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) out = t.pEnv->CallBooleanMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -445,23 +362,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCurrency( sal_Int32 column ) thr sal_Bool SAL_CALL java_sql_ResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isAutoIncrement" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isAutoIncrement"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isAutoIncrement"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) out = t.pEnv->CallBooleanMethod( object, mID, column); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -473,23 +384,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isAutoIncrement( sal_Int32 column sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isSigned" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isSigned"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isSigned"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ) out = t.pEnv->CallBooleanMethod( object, mID, column); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -499,23 +404,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSigned( sal_Int32 column ) throw // ------------------------------------------------------------------------- sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getPrecision" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)I"; + static const char * cMethodName = "getPrecision"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)I"; - static const char * cMethodName = "getPrecision"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -526,23 +425,17 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getPrecision( sal_Int32 column ) // ------------------------------------------------------------------------- sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::getScale" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)I"; + static const char * cMethodName = "getScale"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)I"; - static const char * cMethodName = "getScale"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -553,23 +446,17 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getScale( sal_Int32 column ) thro // ------------------------------------------------------------------------- sal_Int32 SAL_CALL java_sql_ResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isNullable" ); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)I"; + static const char * cMethodName = "isNullable"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)I"; - static const char * cMethodName = "isNullable"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallIntMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -581,23 +468,17 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::isNullable( sal_Int32 column ) th sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isSearchable" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isSearchable"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isSearchable"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -609,23 +490,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSearchable( sal_Int32 column ) t sal_Bool SAL_CALL java_sql_ResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isReadOnly" ); jboolean out(sal_False); SDBThreadAttach t; - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isReadOnly"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isReadOnly"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -637,23 +512,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isReadOnly( sal_Int32 column ) thr sal_Bool SAL_CALL java_sql_ResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isDefinitelyWritable" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isDefinitelyWritable"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isDefinitelyWritable"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen @@ -664,23 +533,17 @@ sal_Bool SAL_CALL java_sql_ResultSetMetaData::isDefinitelyWritable( sal_Int32 co // ------------------------------------------------------------------------- sal_Bool SAL_CALL java_sql_ResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "jdbc", "Ocke.Janssen@sun.com", "java_sql_ResultSetMetaData::isWritable" ); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); - { + if( t.pEnv ){ // temporaere Variable initialisieren + static const char * cSignature = "(I)Z"; + static const char * cMethodName = "isWritable"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) - { - static const char * cSignature = "(I)Z"; - static const char * cMethodName = "isWritable"; - - mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); - if ( !mID ) - throw SQLException(); - } - { + mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!"); + if( mID ){ out = t.pEnv->CallBooleanMethod( object, mID, column ); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); // und aufraeumen diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk index 77cb92f49c..58287b0bf8 100644 --- a/connectivity/source/drivers/jdbc/makefile.mk +++ b/connectivity/source/drivers/jdbc/makefile.mk @@ -105,7 +105,7 @@ SHL1IMPLIB= i$(JDBC_TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -# DEF1EXPORTFILE= exports.dxp +DEF1EXPORTFILE= exports.dxp .ENDIF # SOLAR_JAVA diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx index 37fd490460..ea6ee3f900 100644 --- a/connectivity/source/inc/java/lang/Object.hxx +++ b/connectivity/source/inc/java/lang/Object.hxx @@ -65,7 +65,6 @@ namespace connectivity { jvmaccess::VirtualMachine::AttachGuard m_aGuard; SDBThreadAttach(SDBThreadAttach&); - SDBThreadAttach& operator= (SDBThreadAttach&); public: SDBThreadAttach(); ~SDBThreadAttach(); @@ -87,8 +86,8 @@ namespace connectivity class java_lang_Object { // Zuweisungsoperator und Copy Konstruktor sind verboten - java_lang_Object& operator= (java_lang_Object&); - java_lang_Object(java_lang_Object&); + java_lang_Object& operator = (java_lang_Object&) { return *this;}; + java_lang_Object(java_lang_Object&) {}; static jclass getMyClass(); // nur zum Zerstoeren des C++ Pointers in vom JSbxObject diff --git a/connectivity/source/inc/java/sql/ResultSetMetaData.hxx b/connectivity/source/inc/java/sql/ResultSetMetaData.hxx index e46f44cee1..f62b0701c3 100644 --- a/connectivity/source/inc/java/sql/ResultSetMetaData.hxx +++ b/connectivity/source/inc/java/sql/ResultSetMetaData.hxx @@ -47,7 +47,6 @@ namespace connectivity protected: java::sql::ConnectionLog m_aLogger; java_sql_Connection* m_pConnection; - sal_Int32 m_nColumnCount; // statische Daten fuer die Klasse static jclass theClass; |