summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2009-02-12 14:21:15 +0000
committerOcke Janssen <oj@openoffice.org>2009-02-12 14:21:15 +0000
commitbc144a1985f8c38a9a65a1a286ac4b6a65a0c1f6 (patch)
treecc4a243ef94ab644fbe8ebf009fa4ae930a67e5c
parenta3be17d65e334e53dc0b95226aa0bbd5607b6121 (diff)
reduce call to resiltset meta data
-rw-r--r--connectivity/inc/connectivity/FValue.hxx12
-rw-r--r--connectivity/source/commontools/FValue.cxx145
-rw-r--r--connectivity/source/drivers/jdbc/DatabaseMetaData.cxx75
-rw-r--r--connectivity/source/drivers/jdbc/Object.cxx7
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx1169
-rw-r--r--connectivity/source/drivers/jdbc/ResultSetMetaData.cxx369
-rw-r--r--connectivity/source/drivers/jdbc/makefile.mk2
-rw-r--r--connectivity/source/inc/java/lang/Object.hxx5
-rw-r--r--connectivity/source/inc/java/sql/ResultSetMetaData.hxx1
9 files changed, 1161 insertions, 624 deletions
diff --git a/connectivity/inc/connectivity/FValue.hxx b/connectivity/inc/connectivity/FValue.hxx
index 8dba9e7ee9..850a024a3b 100644
--- a/connectivity/inc/connectivity/FValue.hxx
+++ b/connectivity/inc/connectivity/FValue.hxx
@@ -344,6 +344,18 @@ 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 fc212b1568..0634d041a6 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -36,6 +36,7 @@
#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;
@@ -47,10 +48,12 @@ 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:
@@ -196,65 +199,65 @@ namespace tracing
// -----------------------------------------------------------------------------
void ORowSetValue::setTypeKind(sal_Int32 _eType)
{
- if (!m_bNull)
- if (!isStorageCompatible(_eType, m_eTypeKind))
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::setTypeKind" );
+ if ( !m_bNull && !isStorageCompatible(_eType, m_eTypeKind) )
+ {
+ switch(_eType)
{
- 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::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;
}
@@ -262,6 +265,7 @@ 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)
@@ -348,7 +352,7 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH)
if(&_rRH == this)
return *this;
- if ( m_eTypeKind != _rRH.m_eTypeKind || _rRH.m_bNull || m_bSigned != _rRH.m_bSigned)
+ if ( m_eTypeKind != _rRH.m_eTypeKind || (_rRH.m_bNull && !m_bNull) || m_bSigned != _rRH.m_bSigned)
free();
m_bBound = _rRH.m_bBound;
@@ -848,6 +852,7 @@ 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())
{
@@ -939,6 +944,7 @@ 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)
{
@@ -1014,6 +1020,7 @@ 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)
{
@@ -1084,6 +1091,7 @@ 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;
@@ -1148,6 +1156,7 @@ 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;
@@ -1212,6 +1221,7 @@ 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)
{
@@ -1276,6 +1286,7 @@ 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)
{
@@ -1340,6 +1351,7 @@ 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)
{
@@ -1408,6 +1420,7 @@ float ORowSetValue::getFloat() const
// -------------------------------------------------------------------------
double ORowSetValue::getDouble() const
{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDouble" );
double nRet = 0;
@@ -1478,6 +1491,7 @@ 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;
@@ -1564,6 +1578,7 @@ 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)
{
@@ -1605,6 +1620,7 @@ 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)
{
@@ -1643,6 +1659,7 @@ 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)
{
@@ -1680,6 +1697,7 @@ 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)
{
@@ -1726,6 +1744,7 @@ 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;
@@ -1792,6 +1811,15 @@ 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)
{
@@ -1863,13 +1891,14 @@ void ORowSetValue::fill(sal_Int32 _nPos,
bReadData = sal_False;
break;
}
- if ( bReadData && _xRow->wasNull() )
+ if ( bReadData && _bNullable && _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 6786ef0994..eded040365 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,15 +565,18 @@ 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!" );
+ OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callBooleanMethod:: unknown method id!" );
+ if ( !_inout_MethodID )
+ throw SQLException();
+ } // if ( !_inout_MethodID )
// call method
- if ( _inout_MethodID )
{
out = t.pEnv->CallBooleanMethod( object, _inout_MethodID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -593,15 +596,18 @@ 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!" );
-
+ OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callStringMethod: unknown method id!" );
+ if ( !_inout_MethodID )
+ throw SQLException();
+ }
// call method
- if ( _inout_MethodID )
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, _inout_MethodID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -629,15 +635,19 @@ 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!" );
+ OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callIntMethod: unknown method id!" );
+ if ( !_inout_MethodID )
+ throw SQLException();
+ }
// call method
- if ( _inout_MethodID )
+
{
out = t.pEnv->CallIntMethod( object, _inout_MethodID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -656,15 +666,18 @@ 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!" );
-
+ OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg: unknown method id!" );
+ if ( !_inout_MethodID )
+ throw SQLException();
+ }
// call method
- if ( _inout_MethodID )
+
{
out = t.pEnv->CallBooleanMethod( object, _inout_MethodID, _nArgument );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -684,15 +697,19 @@ 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!" );
+ OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callResultSetMethod: unknown method id!" );
+ if ( !_inout_MethodID )
+ throw SQLException();
+ }
// call method
- if ( _inout_MethodID )
+
{
out = t.pEnv->CallObjectMethod( object, _inout_MethodID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -731,18 +748,22 @@ 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!" );
+ OSL_ENSURE( _inout_MethodID, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: unknown method id!" );
+ if ( !_inout_MethodID )
+ throw SQLException();
+ }
// call method
- if ( _inout_MethodID )
+
{
jvalue args[4];
// convert parameters
@@ -1105,7 +1126,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 )
@@ -1453,7 +1474,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 )
@@ -1537,7 +1558,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 b5251960a4..8b6e6d3ffc 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,27 +81,32 @@ 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 ba0f070245..ea0b8b5c4c 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -85,6 +85,7 @@ 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);
}
// -----------------------------------------------------------------------------
@@ -133,19 +134,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
clearObject(*t.pEnv);
}
} //t.pEnv
@@ -176,16 +182,21 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
// Parameter konvertieren
jstring str = convertwchar_tToJavaString(t.pEnv,columnName);
out = t.pEnv->CallIntMethod( object, mID, str );
@@ -193,7 +204,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;
}
@@ -205,20 +216,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -229,20 +245,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -254,20 +275,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID, columnIndex );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return out;
}
@@ -278,20 +304,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallByteMethod( object, mID, columnIndex);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return out;
}
@@ -302,15 +333,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::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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
jbyteArray out = (jbyteArray)t.pEnv->CallObjectMethod( object, mID, columnIndex);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
if (out)
@@ -321,7 +357,7 @@ Sequence< sal_Int8 > SAL_CALL java_sql_ResultSet::getBytes( sal_Int32 columnInde
t.pEnv->DeleteLocalRef(out);
}
// und aufraeumen
- } //mID
+
} //t.pEnv
return aSeq;
}
@@ -332,20 +368,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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();
@@ -357,20 +398,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallDoubleMethod( object, mID, columnIndex);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return out;
}
@@ -381,20 +427,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallFloatMethod( object, mID, columnIndex );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return out;
}
@@ -405,20 +456,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallIntMethod( object, mID, columnIndex );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return (sal_Int32)out;
}
@@ -429,19 +485,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallIntMethod( object, mID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return (sal_Int32)out;
}
@@ -452,19 +513,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallLongMethod( object, mID, columnIndex );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return out;
}
@@ -475,20 +541,24 @@ 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 )
- 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 );
+ {
+ 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();
}
+
+ 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 );
@@ -499,19 +569,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -523,19 +598,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -546,19 +626,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -570,19 +655,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -594,24 +684,29 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 );
@@ -623,19 +718,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallShortMethod( object, mID, columnIndex);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
- } //mID
+
} //t.pEnv
return (sal_Int16)out;
}
@@ -647,20 +747,22 @@ 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 )
- 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
+ {
+ 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);
} //t.pEnv
// ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!!
return aStr;
@@ -673,20 +775,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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();
@@ -699,19 +806,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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();
@@ -723,20 +835,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -746,20 +863,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -769,20 +891,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -791,20 +918,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
}
// -------------------------------------------------------------------------
@@ -812,20 +944,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
}
// -------------------------------------------------------------------------
@@ -842,19 +979,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -865,19 +1007,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -887,19 +1034,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID,row);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -909,19 +1061,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID,row);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -931,20 +1088,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -961,19 +1123,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -983,19 +1150,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -1005,19 +1177,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -1028,19 +1205,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -1051,20 +1233,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -1075,19 +1262,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
return out;
}
@@ -1097,19 +1289,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
}
// -------------------------------------------------------------------------
@@ -1118,19 +1315,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1139,19 +1340,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 )
@@ -1170,19 +1376,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1190,19 +1400,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1210,19 +1424,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1231,19 +1449,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1252,19 +1474,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1273,19 +1499,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1294,19 +1524,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1315,19 +1549,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1335,19 +1573,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1356,19 +1598,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1376,19 +1622,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1396,19 +1646,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1418,19 +1672,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1439,19 +1697,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID,columnIndex,x);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- }
}
}
// -------------------------------------------------------------------------
@@ -1460,17 +1722,22 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
// Parameter konvertieren
jstring str = convertwchar_tToJavaString(t.pEnv,x);
@@ -1486,16 +1753,21 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jbyteArray aArray = t.pEnv->NewByteArray(x.getLength());
t.pEnv->SetByteArrayRegion(aArray,0,x.getLength(),(jbyte*)x.getConstArray());
@@ -1512,17 +1784,22 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jvalue args[1];
// Parameter konvertieren
@@ -1539,16 +1816,21 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jvalue args[1];
// Parameter konvertieren
@@ -1565,16 +1847,21 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jvalue args[1];
java_sql_Timestamp aD(x);
@@ -1621,17 +1908,22 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
// Parameter konvertieren
double nTemp = 0.0;
@@ -1659,20 +1951,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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;
}
@@ -1683,20 +1980,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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;
}
@@ -1706,20 +2008,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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;
}
@@ -1729,20 +2036,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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;
}
@@ -1752,20 +2064,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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;
@@ -1776,20 +2092,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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
}
@@ -1798,19 +2119,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
t.pEnv->CallVoidMethod( object, mID);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
- } //mID
+
} //t.pEnv
}
//------------------------------------------------------------------------------
@@ -1818,19 +2144,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
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 b5b307660c..ef3d35b8a5 100644
--- a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
@@ -33,6 +33,8 @@
#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;
@@ -40,6 +42,8 @@ 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
//**************************************************************
@@ -49,7 +53,9 @@ 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()
@@ -59,6 +65,7 @@ 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!");
@@ -74,6 +81,7 @@ 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
@@ -83,18 +91,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallIntMethod( object, mID,column);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
} //mID
@@ -105,18 +119,24 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallIntMethod( object, mID,column);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
} //mID
@@ -127,39 +147,54 @@ sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnType( sal_Int32 column )
sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
{
- jint out(0);
- SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
- if( t.pEnv ){
+ 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;
- // 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -169,17 +204,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -194,17 +235,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -218,17 +265,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -242,17 +295,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -266,17 +325,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -290,17 +355,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -314,17 +385,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
{
jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
@@ -339,19 +416,25 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -362,17 +445,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID, column);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -384,17 +473,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+
out = t.pEnv->CallBooleanMethod( object, mID, column);
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -404,17 +499,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallIntMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -425,17 +526,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallIntMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -446,17 +553,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallIntMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -468,17 +581,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallBooleanMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -490,17 +609,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallBooleanMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -512,17 +637,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
out = t.pEnv->CallBooleanMethod( object, mID, column );
ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
// und aufraeumen
@@ -533,17 +664,23 @@ 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 )
- mID = t.pEnv->GetMethodID( getMyClass(), cMethodName, cSignature );OSL_ENSURE(mID,"Unknown method id!");
- 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();
+ }
+ {
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 58287b0bf8..77cb92f49c 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 ea6ee3f900..37fd490460 100644
--- a/connectivity/source/inc/java/lang/Object.hxx
+++ b/connectivity/source/inc/java/lang/Object.hxx
@@ -65,6 +65,7 @@ namespace connectivity
{
jvmaccess::VirtualMachine::AttachGuard m_aGuard;
SDBThreadAttach(SDBThreadAttach&);
+ SDBThreadAttach& operator= (SDBThreadAttach&);
public:
SDBThreadAttach();
~SDBThreadAttach();
@@ -86,8 +87,8 @@ namespace connectivity
class java_lang_Object
{
// Zuweisungsoperator und Copy Konstruktor sind verboten
- java_lang_Object& operator = (java_lang_Object&) { return *this;};
- java_lang_Object(java_lang_Object&) {};
+ java_lang_Object& operator= (java_lang_Object&);
+ 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 f62b0701c3..e46f44cee1 100644
--- a/connectivity/source/inc/java/sql/ResultSetMetaData.hxx
+++ b/connectivity/source/inc/java/sql/ResultSetMetaData.hxx
@@ -47,6 +47,7 @@ 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;