40#include <com/sun/star/beans/PropertyAttribute.hpp>
66jclass java_sql_ResultSet::theClass =
nullptr;
71 ,m_aLogger( _rParentLogger, java::
sql::ConnectionLog::RESULTSET )
72 ,m_pConnection(&_rConnection)
84 if ( !java_sql_ResultSet_BASE::rBHelper.bDisposed && !java_sql_ResultSet_BASE::rBHelper.bInDispose )
108 static jmethodID mID(
nullptr);
119 return aRet.hasValue() ? aRet : java_sql_ResultSet_BASE::queryInterface(rType);
128 return ::comphelper::concatSequences(
aTypes.getTypes(),java_sql_ResultSet_BASE::getTypes());
134 static jmethodID mID(
nullptr);
141 static jmethodID mID(
nullptr);
151 static jmethodID mID(
nullptr);
161 static jmethodID mID(
nullptr);
168 static jmethodID mID(
nullptr);
169 jbyte (JNIEnv::*
const pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallByteMethod;
170 return callMethodWithIntArg<jbyte>(pCallMethod,
"getByte",
"(I)B",mID,columnIndex);
176 Sequence< sal_Int8 >
aSeq;
178 static jmethodID mID(
nullptr);
183 aSeq.realloc(
t.pEnv->GetArrayLength(out));
184 memcpy(
aSeq.getArray(),
t.pEnv->GetByteArrayElements(out,&
p),
aSeq.getLength());
185 t.pEnv->DeleteLocalRef(out);
194 static jmethodID mID(
nullptr);
197 return out ?
static_cast <css::util::Date
> (
java_sql_Date(
t.pEnv, out )) : css::util::Date();
203 static jmethodID mID(
nullptr);
204 jdouble (JNIEnv::*
const pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallDoubleMethod;
205 return callMethodWithIntArg<double>(pCallMethod,
"getDouble",
"(I)D",mID,columnIndex);
211 static jmethodID mID(
nullptr);
212 jfloat (JNIEnv::*
const pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallFloatMethod;
213 return callMethodWithIntArg<jfloat>(pCallMethod,
"getFloat",
"(I)F",mID,columnIndex);
219 static jmethodID mID(
nullptr);
226 static jmethodID mID(
nullptr);
233 static jmethodID mID(
nullptr);
234 jlong (JNIEnv::*
const pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallLongMethod;
235 return callMethodWithIntArg<jlong>(pCallMethod,
"getLong",
"(I)J",mID,columnIndex);
242 static jmethodID mID(
nullptr);
243 jobject out =
callObjectMethod(
t.pEnv,
"getMetaData",
"()Ljava/sql/ResultSetMetaData;", mID);
251 static jmethodID mID(
nullptr);
262 static jmethodID mID(
nullptr);
271 static jmethodID mID(
nullptr);
281 static jmethodID mID(
nullptr);
285 return out==
nullptr ? nullptr :
new java_sql_Ref(
t.pEnv, out );
296 args[0].i = columnIndex;
300 static jmethodID mID(
nullptr);
303 static const char *
const cSignature =
"(I)Ljava/lang/Object;";
304 static const char *
const cMethodName =
"getObject";
309 jobject out =
t.pEnv->CallObjectMethodA(
object, mID,
args);
310 t.pEnv->DeleteLocalRef(
static_cast<jstring
>(
args[1].l));
318 aRet <<= OUString(aVal);
323 static jmethodID methodID =
nullptr;
329 aRet <<= css::util::Date(aVal);
334 aRet <<= css::util::Time(aVal);
339 aRet <<= css::util::DateTime(aVal);
342 t.pEnv->DeleteLocalRef(out);
351 static jmethodID mID(
nullptr);
352 jshort (JNIEnv::*
const pCallMethod)( jobject obj, jmethodID methodID, ... ) = &JNIEnv::CallShortMethod;
353 return callMethodWithIntArg<jshort>(pCallMethod,
"getShort",
"(I)S",mID,columnIndex);
359 static jmethodID mID(
nullptr);
367 static jmethodID mID(
nullptr);
370 return out ?
static_cast <css::util::Time
> (
java_sql_Time(
t.pEnv, out )) : css::util::Time();
377 static jmethodID mID(
nullptr);
380 return out ?
static_cast <css::util::DateTime
> (
java_sql_Timestamp(
t.pEnv, out )) : css::util::DateTime();
386 static jmethodID mID(
nullptr);
392 static jmethodID mID(
nullptr);
398 static jmethodID mID(
nullptr);
404 static jmethodID mID(
nullptr);
410 static jmethodID mID(
nullptr);
423 static jmethodID mID(
nullptr);
430 static jmethodID mID(
nullptr);
436 static jmethodID mID(
nullptr);
442 static jmethodID mID(
nullptr);
448 static jmethodID mID(
nullptr);
460 static jmethodID mID(
nullptr);
466 static jmethodID mID(
nullptr);
472 static jmethodID mID(
nullptr);
479 static jmethodID mID(
nullptr);
486 static jmethodID mID(
nullptr);
492 static jmethodID mID(
nullptr);
498 static jmethodID mID(
nullptr);
504 static jmethodID mID(
nullptr);
511 static jmethodID mID(
nullptr);
512 jobject out =
callObjectMethod(
t.pEnv,
"getWarnings",
"()Ljava/sql/SQLWarning;", mID);
518 static_cast< css::sdbc::SQLException
>(
522 return css::uno::Any();
528 static jmethodID mID(
nullptr);
534 static jmethodID mID(
nullptr);
540 static jmethodID mID(
nullptr);
547 static jmethodID mID(
nullptr);
554 static jmethodID mID(
nullptr);
561 static jmethodID mID(
nullptr);
568 static jmethodID mID(
nullptr);
575 static jmethodID mID(
nullptr);
581 static jmethodID mID(
nullptr);
588 static jmethodID mID(
nullptr);
594 static jmethodID mID(
nullptr);
600 static jmethodID mID(
nullptr);
607 static jmethodID mID(
nullptr);
614 static jmethodID mID(
nullptr);
626 static jmethodID mID(
nullptr);
629 static const char *
const cSignature =
"(ILjava/lang/String;)V";
630 static const char *
const cMethodName =
"updateString";
638 t.pEnv->CallVoidMethod(
object, mID,columnIndex,str.
get());
652 static jmethodID mID(
nullptr);
655 static const char *
const cSignature =
"(I[B)V";
656 static const char *
const cMethodName =
"updateBytes";
662 jbyteArray aArray =
t.pEnv->NewByteArray(
x.getLength());
663 jbyte *
pData =
reinterpret_cast<jbyte *
>(
664 const_cast<sal_Int8 *
>(
x.getConstArray()));
671 t.pEnv->SetByteArrayRegion(aArray,0,
x.getLength(),
pData);
673 t.pEnv->CallVoidMethod(
object, mID,columnIndex,aArray);
674 t.pEnv->DeleteLocalRef(aArray);
684 static jmethodID mID(
nullptr);
692 static jmethodID mID(
nullptr);
700 static jmethodID mID(
nullptr);
714 static jmethodID mID(
nullptr);
717 static const char *
const cSignature =
"(ILjava/io/InputStream;I)V";
718 static const char *
const cMethodName =
"updateBinaryStream";
725 t.pEnv->CallVoidMethod(
object, mID, columnIndex,obj,
length);
732 Any anyEx = ::cppu::getCaughtException();
746 static jmethodID mID(
nullptr);
749 static const char *
const cSignature =
"(ILjava/io/Reader;I)V";
750 static const char *
const cMethodName =
"updateCharacterStream";
757 t.pEnv->CallVoidMethod(
object, mID, columnIndex,obj,
length);
764 Any anyEx = ::cppu::getCaughtException();
775 STR_UNKNOWN_COLUMN_TYPE,
776 "$position$", OUString::number(columnIndex)
794 static jmethodID mID(
nullptr);
797 static const char *
const cSignature =
"(ILjava/lang/Object;I)V";
798 static const char *
const cMethodName =
"updateObject";
806 std::unique_ptr<java_math_BigDecimal> pBigDecimal;
814 t.pEnv->CallVoidMethod(
object, mID, columnIndex,pBigDecimal->getJavaObject(),
scale);
827 static jmethodID mID(
nullptr);
833 static jmethodID mID(
nullptr);
839 static jmethodID mID(
nullptr);
845 static jmethodID mID(
nullptr);
851 static jmethodID mID(
nullptr);
858 static jmethodID mID(
nullptr);
864 static jmethodID mID(
nullptr);
870 static jmethodID mID(
nullptr);
876 return new ::cppu::OPropertyArrayHelper
883 PropertyAttribute::READONLY
901 PropertyAttribute::READONLY
907 PropertyAttribute::READONLY
919 css::uno::Any & rConvertedValue,
920 css::uno::Any & rOldValue,
922 const css::uno::Any& rValue )
930 throw css::lang::IllegalArgumentException();
932 bRet = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchDirection());
935 bRet = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchSize());
946 const css::uno::Any& rValue
954 throw css::uno::Exception(
"cannot set prop " + OUString::number(
nHandle),
nullptr);
967 css::uno::Any& rValue,
999 java_sql_ResultSet_BASE::acquire();
1004 java_sql_ResultSet_BASE::release();
1009 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper());
::cppu::IPropertyArrayHelper * getArrayHelper()
void disposing(std::unique_lock< std::mutex > &rGuard)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
helper class for accessing resources shared by different libraries in the connectivity module
OUString getResourceStringWithSubstitution(TranslateId pResId, const char *_pAsciiPatternToReplace, const OUString &_rStringToSubstitute) const
loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
static jclass st_getMyClass()
jobject callObjectMethod(JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
sal_Int32 callIntMethod_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID) const
bool callBooleanMethod(const char *_pMethodName, jmethodID &_inout_MethodID) const
sal_Int32 callIntMethodWithStringArg(const char *_pMethodName, jmethodID &_inout_MethodID, const OUString &_nArgument) const
void callVoidMethod_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID) const
sal_Int32 callIntMethodWithIntArg_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
void callVoidMethodWithIntArg_ThrowSQL(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
void callVoidMethodWithIntArg_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
OUString callStringMethod(const char *_pMethodName, jmethodID &_inout_MethodID) const
jobject callObjectMethodWithIntArg(JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
bool callBooleanMethodWithIntArg(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
OUString callStringMethodWithIntArg(const char *_pMethodName, jmethodID &_inout_MethodID, sal_Int32 _nArgument) const
sal_Int32 callIntMethod_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID) const
static void ThrowLoggedSQLException(const ::comphelper::EventLogger &_rLogger, JNIEnv *pEnvironment, const css::uno::Reference< css::uno::XInterface > &_rxContext)
jobject getJavaObject() const
static jclass findMyClass(const char *_pClassName)
void callVoidMethod_ThrowRuntime(const char *_pMethodName, jmethodID &_inout_MethodID) const
void obtainMethodId_throwSQL(JNIEnv *_pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
static jclass st_getMyClass()
static jclass st_getMyClass()
virtual void SAL_CALL moveToInsertRow() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual void SAL_CALL moveToCurrentRow() override
virtual sal_Bool SAL_CALL isLast() override
virtual void SAL_CALL clearWarnings() override
virtual void SAL_CALL updateShort(sal_Int32 columnIndex, sal_Int16 x) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex, sal_Bool x) override
virtual jclass getMyClass() const override
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual void SAL_CALL updateTime(sal_Int32 columnIndex, const css::util::Time &x) override
virtual void SAL_CALL release() noexcept override
virtual sal_Bool SAL_CALL isAfterLast() override
sal_Int32 getFetchDirection() const
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
virtual void SAL_CALL updateFloat(sal_Int32 columnIndex, float x) override
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual sal_Bool SAL_CALL isFirst() override
virtual ~java_sql_ResultSet() override
sal_Int32 getResultSetConcurrency() const
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual void SAL_CALL updateInt(sal_Int32 columnIndex, sal_Int32 x) override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL updateNull(sal_Int32 columnIndex) override
sal_Int32 getFetchSize() const
virtual void SAL_CALL disposing() override
virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const css::uno::Any &x) override
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual void SAL_CALL deleteRow() override
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
OUString getCursorName() const
virtual sal_Bool SAL_CALL rowInserted() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
void setFetchSize(sal_Int32 _par0)
virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex, const css::uno::Any &x, sal_Int32 scale) override
virtual sal_Int32 SAL_CALL getRow() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
void setFetchDirection(sal_Int32 _par0)
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual void SAL_CALL refreshRow() override
virtual void SAL_CALL updateString(sal_Int32 columnIndex, const OUString &x) override
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
virtual void SAL_CALL insertRow() override
virtual void SAL_CALL updateByte(sal_Int32 columnIndex, sal_Int8 x) override
virtual void SAL_CALL updateLong(sal_Int32 columnIndex, sal_Int64 x) override
virtual void SAL_CALL cancel() override
virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual css::uno::Any SAL_CALL getWarnings() override
java::sql::ConnectionLog m_aLogger
virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
css::uno::Reference< css::uno::XInterface > m_xStatement
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual void SAL_CALL beforeFirst() override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual void SAL_CALL cancelRowUpdates() override
virtual sal_Bool SAL_CALL previous() override
virtual sal_Bool SAL_CALL last() override
virtual void SAL_CALL updateBytes(sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 > &x) override
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL rowUpdated() override
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
virtual void SAL_CALL close() override
virtual void SAL_CALL updateDate(sal_Int32 columnIndex, const css::util::Date &x) override
sal_Int32 getResultSetType() const
virtual sal_Bool SAL_CALL first() override
virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex, const css::util::DateTime &x) override
virtual sal_Bool SAL_CALL next() override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual sal_Bool SAL_CALL wasNull() override
virtual void SAL_CALL afterLast() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL updateDouble(sal_Int32 columnIndex, double x) override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
virtual sal_Int32 SAL_CALL findColumn(const OUString &columnName) override
java_sql_Connection * m_pConnection
virtual void SAL_CALL updateRow() override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
static jclass st_getMyClass()
static jclass st_getMyClass()
helper class to hold a local ref to a JNI object
mutable::osl::Mutex m_aMutex
css::uno::Type const & get()
IMPLEMENT_SERVICE_INFO(java_sql_ResultSet,"com.sun.star.sdbcx.JResultSet","com.sun.star.sdbc.ResultSet")
Sequence< sal_Int8 > aSeq
std::unique_ptr< sal_Int32[]> pData
sal_Int32 getINT32(const Any &_rAny)
jobject convertTypeMapToJavaMap(const css::uno::Reference< css::container::XNameAccess > &_rMap)
jobject createCharArrayReader(const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length)
::cppu::WeakComponentImplHelper< css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::util::XCancellable, css::sdbc::XWarningsSupplier, css::sdbc::XResultSetUpdate, css::sdbc::XRowUpdate, css::sdbc::XCloseable, css::sdbc::XColumnLocate, css::lang::XServiceInfo > java_sql_ResultSet_BASE
jstring convertwchar_tToJavaString(JNIEnv *pEnv, const OUString &Temp)
jobject createByteInputStream(const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length)
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_CURSORNAME
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_FETCHDIRECTION