xref: /AOO41X/main/mysqlc/source/mysqlc_resultset.cxx (revision 079eb5772d0a9e49bbf5c2cd738fc5b5d43e5181)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #include "mysqlc_propertyids.hxx"
23 #include "mysqlc_general.hxx"
24 #include "mysqlc_resultset.hxx"
25 #include "mysqlc_resultsetmetadata.hxx"
26 
27 #include <com/sun/star/sdbc/DataType.hpp>
28 #include <com/sun/star/beans/PropertyAttribute.hpp>
29 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
30 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
31 #include <com/sun/star/sdbc/ResultSetType.hpp>
32 #include <com/sun/star/sdbc/FetchDirection.hpp>
33 #include <cppuhelper/typeprovider.hxx>
34 #include <com/sun/star/lang/DisposedException.hpp>
35 
36 using namespace connectivity::mysqlc;
37 using namespace cppu;
38 using namespace com::sun::star::uno;
39 using namespace com::sun::star::lang;
40 using namespace com::sun::star::beans;
41 using namespace com::sun::star::sdbc;
42 using namespace com::sun::star::sdbcx;
43 using namespace com::sun::star::container;
44 using namespace com::sun::star::io;
45 using namespace com::sun::star::util;
46 using ::osl::MutexGuard;
47 using ::rtl::OUString;
48 
49 #include <cppconn/resultset.h>
50 #include <cppconn/resultset_metadata.h>
51 
52 #include <stdio.h>
53 
54 
55 //  IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
56 /* {{{ OResultSet::getImplementationName() -I- */
getImplementationName()57 OUString SAL_CALL OResultSet::getImplementationName()
58     throw (RuntimeException)
59 {
60     OSL_TRACE("OResultSet::getImplementationName");
61     return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.mysqlc.ResultSet" ) );
62 }
63 /* }}} */
64 
65 
66 /* {{{ OResultSet::getSupportedServiceNames() -I- */
getSupportedServiceNames()67 Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames()
68     throw(RuntimeException)
69 {
70     OSL_TRACE("OResultSet::getSupportedServiceNames");
71     Sequence< OUString > aSupported(2);
72     aSupported[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbc.ResultSet" ) );
73     aSupported[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.ResultSet" ) );
74     return (aSupported);
75 }
76 /* }}} */
77 
78 
79 /* {{{ OResultSet::supportsService() -I- */
supportsService(const OUString & _rServiceName)80 sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName)
81     throw(RuntimeException)
82 {
83     OSL_TRACE("OResultSet::supportsService");
84     Sequence< OUString > aSupported(getSupportedServiceNames());
85     const OUString* pSupported = aSupported.getConstArray();
86     const OUString* pEnd = pSupported + aSupported.getLength();
87     for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) {}
88 
89     return (pSupported != pEnd);
90 }
91 /* }}} */
92 
93 
94 /* {{{ OResultSet::OResultSet() -I- */
OResultSet(OCommonStatement * pStmt,sql::ResultSet * result,rtl_TextEncoding _encoding)95 OResultSet::OResultSet(OCommonStatement * pStmt, sql::ResultSet * result, rtl_TextEncoding _encoding )
96     : OResultSet_BASE(m_aMutex)
97     ,OPropertySetHelper(OResultSet_BASE::rBHelper)
98     ,m_aStatement((OWeakObject*)pStmt)
99     ,m_xMetaData(NULL)
100     ,m_result(result)
101     ,fieldCount( 0 )
102     ,m_encoding( _encoding )
103 {
104     OSL_TRACE("OResultSet::OResultSet");
105     try {
106         sql::ResultSetMetaData * rs_meta = m_result->getMetaData();
107         fieldCount = rs_meta->getColumnCount();
108     } catch (sql::SQLException &e) {
109         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
110     }
111 }
112 /* }}} */
113 
114 
115 /* {{{ OResultSet::~OResultSet() -I- */
~OResultSet()116 OResultSet::~OResultSet()
117 {
118     OSL_TRACE("OResultSet::~OResultSet");
119 }
120 /* }}} */
121 
122 
123 /* {{{ OResultSet::disposing() -I- */
disposing()124 void OResultSet::disposing()
125 {
126     OSL_TRACE("OResultSet::disposing");
127     OPropertySetHelper::disposing();
128 
129     MutexGuard aGuard(m_aMutex);
130 
131     m_aStatement = NULL;
132     m_xMetaData  = NULL;
133 }
134 /* }}} */
135 
136 
137 /* {{{ OResultSet::queryInterface() -I- */
queryInterface(const Type & rType)138 Any SAL_CALL OResultSet::queryInterface(const Type & rType)
139     throw(RuntimeException)
140 {
141     OSL_TRACE("OResultSet::queryInterface");
142     Any aRet = OPropertySetHelper::queryInterface(rType);
143     if (!aRet.hasValue()) {
144         aRet = OResultSet_BASE::queryInterface(rType);
145     }
146     return aRet;
147 }
148 /* }}} */
149 
150 
151 /* {{{ OResultSet::getTypes() -I- */
getTypes()152 Sequence< Type > SAL_CALL OResultSet::getTypes()
153     throw(RuntimeException)
154 {
155     OSL_TRACE("OResultSet::getTypes");
156     OTypeCollection aTypes( ::getCppuType((const  Reference< XMultiPropertySet > *) NULL),
157                                                 ::getCppuType((const Reference< XFastPropertySet > *) NULL),
158                                                 ::getCppuType((const Reference< XPropertySet > *) NULL));
159 
160     return concatSequences(aTypes.getTypes(), OResultSet_BASE::getTypes());
161 }
162 /* }}} */
163 
164 
165 /* {{{ OResultSet::findColumn() -I- */
findColumn(const OUString & columnName)166 sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& columnName)
167     throw(SQLException, RuntimeException)
168 {
169     OSL_TRACE("OResultSet::findColumn");
170     MutexGuard aGuard(m_aMutex);
171     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
172 
173     try {
174         // find the first column with the name columnName
175         sql::ResultSetMetaData * meta = m_result->getMetaData();
176         for (sal_uInt32 i = 1; i <= fieldCount; i++) {
177             if (columnName.equalsIgnoreAsciiCaseAscii(meta->getColumnName(i).c_str())) {
178                 /* SDBC knows them indexed from 1 */
179                 return i;
180             }
181         }
182     } catch (sql::SQLException &e) {
183         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
184     }
185     return 0;
186 }
187 /* }}} */
188 
189 
190 /* {{{ OResultSet::getBinaryStream() -U- */
getBinaryStream(sal_Int32 column)191 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream(sal_Int32 column)
192     throw(SQLException, RuntimeException)
193 {
194     OSL_TRACE("OResultSet::getBinaryStream");
195     MutexGuard aGuard(m_aMutex);
196     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
197     checkColumnIndex(column);
198 
199     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBinaryStream", *this);
200     return NULL;
201 }
202 /* }}} */
203 
204 
205 /* {{{ OResultSet::getCharacterStream() -U- */
getCharacterStream(sal_Int32 column)206 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream(sal_Int32 column)
207     throw(SQLException, RuntimeException)
208 {
209     OSL_TRACE("OResultSet::getCharacterStream");
210     MutexGuard aGuard(m_aMutex);
211     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
212     checkColumnIndex(column);
213 
214     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getCharacterStream", *this);
215     return NULL;
216 }
217 /* }}} */
218 
219 
220 /* {{{ OResultSet::getBoolean() -I- */
getBoolean(sal_Int32 column)221 sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 column)
222     throw(SQLException, RuntimeException)
223 {
224     OSL_TRACE("OResultSet::getBoolean");
225     MutexGuard aGuard(m_aMutex);
226     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
227 
228     checkColumnIndex(column);
229     try {
230         return m_result->getBoolean(column)? sal_True:sal_False;
231     } catch (sql::SQLException &e) {
232         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
233     }
234     return sal_False;
235 #if 0
236     OUString str = getString(column);
237     switch (str[0]) {
238         case '1':
239         case 't':
240         case 'T':
241         case 'y':
242         case 'Y':
243             return sal_True;
244     }
245     return sal_False;
246 #endif
247 }
248 /* }}} */
249 
250 
251 /* {{{ OResultSet::getByte() -I- */
getByte(sal_Int32 column)252 sal_Int8 SAL_CALL OResultSet::getByte(sal_Int32 column)
253     throw(SQLException, RuntimeException)
254 {
255     OSL_TRACE("OResultSet::getByte");
256     MutexGuard aGuard(m_aMutex);
257     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
258 
259     checkColumnIndex(column);
260     try {
261         return m_result->getInt(column);
262     } catch (sql::SQLException &e) {
263         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
264     }
265     return 0; // fool compiler
266 }
267 /* }}} */
268 
269 
270 /* {{{ OResultSet::getBytes() -I- */
getBytes(sal_Int32 column)271 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 column)
272     throw(SQLException, RuntimeException)
273 {
274     OSL_TRACE("OResultSet::getBytes");
275 
276     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
277     MutexGuard aGuard(m_aMutex);
278 
279 
280     sql::SQLString val = m_result->getString(column);
281     if (!val.length()) {
282         return Sequence< sal_Int8>();
283     } else {
284         return Sequence< sal_Int8 > ((sal_Int8*)val.c_str(), val.length());
285     }
286 }
287 /* }}} */
288 
289 
290 /* {{{ OResultSet::getDate() -I- */
getDate(sal_Int32 column)291 Date SAL_CALL OResultSet::getDate(sal_Int32 column)
292     throw(SQLException, RuntimeException)
293 {
294     OSL_TRACE("OResultSet::getDate");
295     MutexGuard aGuard(m_aMutex);
296     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
297     checkColumnIndex(column);
298 
299     Date d;
300     try {
301         OUString dateString = getString(column);
302         OUString token;
303         sal_Int32 nIndex = 0, i=0;
304 
305         do {
306             token = dateString.getToken (0, '-', nIndex);
307             switch (i) {
308                 case 0:
309                     d.Year =  static_cast<sal_uInt16>(token.toInt32(10));
310                     break;
311                 case 1:
312                     d.Month =  static_cast<sal_uInt16>(token.toInt32(10));
313                     break;
314                 case 2:
315                     d.Day =  static_cast<sal_uInt16>(token.toInt32(10));
316                     break;
317                 default:;
318             }
319             i++;
320         } while (nIndex >= 0);
321     } catch (sql::SQLException &e) {
322         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
323     }
324     return d;
325 }
326 /* }}} */
327 
328 
329 /* {{{ OResultSet::getDouble() -I- */
getDouble(sal_Int32 column)330 double SAL_CALL OResultSet::getDouble(sal_Int32 column)
331     throw(SQLException, RuntimeException)
332 {
333     OSL_TRACE("OResultSet::getDouble");
334     MutexGuard aGuard(m_aMutex);
335     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
336 
337     checkColumnIndex(column);
338     try {
339         return m_result->getDouble(column);
340     } catch (sql::SQLException &e) {
341         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
342     }
343     return 0.0; // fool compiler
344 }
345 /* }}} */
346 
347 
348 /* {{{ OResultSet::getFloat() -I- */
getFloat(sal_Int32 column)349 float SAL_CALL OResultSet::getFloat(sal_Int32 column)
350     throw(SQLException, RuntimeException)
351 {
352     OSL_TRACE("OResultSet::getFloat");
353     MutexGuard aGuard(m_aMutex);
354     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
355 
356     checkColumnIndex(column);
357     try {
358         return m_result->getDouble(column);
359     } catch (sql::SQLException &e) {
360         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
361     }
362     return 0.0; // fool compiler
363 }
364 /* }}} */
365 
366 
367 /* {{{ OResultSet::getInt() -I- */
getInt(sal_Int32 column)368 sal_Int32 SAL_CALL OResultSet::getInt(sal_Int32 column)
369     throw(SQLException, RuntimeException)
370 {
371     OSL_TRACE("OResultSet::getInt");
372     MutexGuard aGuard(m_aMutex);
373     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
374 
375     checkColumnIndex(column);
376     try {
377         return m_result->getInt(column);
378     } catch (sql::SQLException &e) {
379         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
380     }
381     return 0; // fool compiler
382 }
383 /* }}} */
384 
385 
386 /* {{{ OResultSet::getRow() -I- */
getRow()387 sal_Int32 SAL_CALL OResultSet::getRow()
388     throw(SQLException, RuntimeException)
389 {
390     OSL_TRACE("OResultSet::getRow");
391     MutexGuard aGuard(m_aMutex);
392     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
393 
394     try {
395         return m_result->getRow();
396     } catch (sql::SQLException &e) {
397         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
398     }
399     return 0; // fool compiler
400 }
401 /* }}} */
402 
403 
404 /* {{{ OResultSet::getLong() -I- */
getLong(sal_Int32 column)405 sal_Int64 SAL_CALL OResultSet::getLong(sal_Int32 column)
406     throw(SQLException, RuntimeException)
407 {
408     OSL_TRACE("OResultSet::getLong");
409     MutexGuard aGuard(m_aMutex);
410     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
411 
412     checkColumnIndex(column);
413     try {
414         return m_result->getInt64(column);
415     } catch (sql::SQLException &e) {
416         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
417     }
418     return 0; // fool compiler
419 }
420 /* }}} */
421 
422 
423 /* {{{ OResultSet::getMetaData() -I- */
getMetaData()424 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData()
425     throw(SQLException, RuntimeException)
426 {
427     OSL_TRACE("OResultSet::getMetaData");
428     MutexGuard aGuard(m_aMutex);
429     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
430     try {
431         if (!m_xMetaData.is()) {
432             m_xMetaData = new OResultSetMetaData(m_result->getMetaData(), m_encoding);
433         }
434     } catch (sql::MethodNotImplementedException) {
435         mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getMetaData", *this);
436     } catch (sql::SQLException &e) {
437         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
438     }
439     return m_xMetaData;
440 }
441 /* }}} */
442 
443 
444 /* {{{ OResultSet::getArray() -U- */
getArray(sal_Int32 column)445 Reference< XArray > SAL_CALL OResultSet::getArray(sal_Int32 column)
446     throw(SQLException, RuntimeException)
447 {
448     OSL_TRACE("OResultSet::getArray");
449     MutexGuard aGuard(m_aMutex);
450     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
451     checkColumnIndex(column);
452 
453     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getArray", *this);
454     return NULL;
455 }
456 /* }}} */
457 
458 
459 /* {{{ OResultSet::getClob() -U- */
getClob(sal_Int32 column)460 Reference< XClob > SAL_CALL OResultSet::getClob(sal_Int32 column)
461     throw(SQLException, RuntimeException)
462 {
463     OSL_TRACE("OResultSet::getClob");
464     MutexGuard aGuard(m_aMutex);
465     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
466     checkColumnIndex(column);
467 
468     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getClob", *this);
469     return NULL;
470 }
471 /* }}} */
472 
473 
474 /* {{{ OResultSet::getBlob() -U- */
getBlob(sal_Int32 column)475 Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 column)
476     throw(SQLException, RuntimeException)
477 {
478     OSL_TRACE("OResultSet::getBlob");
479     MutexGuard aGuard(m_aMutex);
480     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
481     checkColumnIndex(column);
482 
483     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBlob", *this);
484     return NULL;
485 }
486 /* }}} */
487 
488 
489 /* {{{ OResultSet::getRef() -U- */
getRef(sal_Int32 column)490 Reference< XRef > SAL_CALL OResultSet::getRef(sal_Int32 column)
491     throw(SQLException, RuntimeException)
492 {
493     OSL_TRACE("OResultSet::getRef");
494     MutexGuard aGuard(m_aMutex);
495     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
496     checkColumnIndex(column);
497 
498     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getRef", *this);
499     return NULL;
500 }
501 /* }}} */
502 
503 
504 /* {{{ OResultSet::getObject() -U- */
getObject(sal_Int32 column,const Reference<XNameAccess> &)505 Any SAL_CALL OResultSet::getObject(sal_Int32 column, const Reference< XNameAccess >& /* typeMap */)
506     throw(SQLException, RuntimeException)
507 {
508     OSL_TRACE("OResultSet::getObject");
509     MutexGuard aGuard(m_aMutex);
510     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
511     checkColumnIndex(column);
512 
513     Any aRet= Any();
514 
515     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getObject", *this);
516     return aRet;
517 }
518 /* }}} */
519 
520 
521 /* {{{ OResultSet::getShort() -I- */
getShort(sal_Int32 column)522 sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 column)
523     throw(SQLException, RuntimeException)
524 {
525     OSL_TRACE("OResultSet::getShort");
526     MutexGuard aGuard(m_aMutex);
527     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
528 
529     try {
530         return (sal_Int16) m_result->getInt(column);
531     } catch (sql::SQLException &e) {
532         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
533     }
534     return 0; // fool compiler
535 }
536 /* }}} */
537 
538 
539 /* {{{ OResultSet::getString() -I- */
getString(sal_Int32 column)540 OUString SAL_CALL OResultSet::getString(sal_Int32 column)
541     throw(SQLException, RuntimeException)
542 {
543     OSL_TRACE("OResultSet::getString");
544     MutexGuard aGuard(m_aMutex);
545     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
546 
547     checkColumnIndex(column);
548 
549     try {
550         sql::SQLString val = m_result->getString(column);
551         if (!m_result->wasNull()) {
552             return OUString( val.c_str(), val.length(), m_encoding );
553         } else {
554             return OUString();
555         }
556     } catch (sql::SQLException &e) {
557         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
558     }
559     return OUString(); // fool compiler
560 }
561 /* }}} */
562 
563 
564 /* {{{ OResultSet::getTime() -I- */
getTime(sal_Int32 column)565 Time SAL_CALL OResultSet::getTime(sal_Int32 column)
566     throw(SQLException, RuntimeException)
567 {
568     OSL_TRACE("OResultSet::getTime");
569     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
570     MutexGuard aGuard(m_aMutex);
571 
572     checkColumnIndex(column);
573     Time t;
574     OUString timeString = getString(column);
575     OUString token;
576     sal_Int32 nIndex, i=0;
577 
578     nIndex = timeString.indexOf(' ') + 1;
579 
580     do {
581         token = timeString.getToken (0, ':', nIndex);
582         switch (i) {
583             case 0:
584                 t.Hours =  static_cast<sal_uInt16>(token.toInt32(10));
585                 break;
586             case 1:
587                 t.Minutes =  static_cast<sal_uInt16>(token.toInt32(10));
588                 break;
589             case 2:
590                 t.Seconds =  static_cast<sal_uInt16>(token.toInt32(10));
591                 break;
592         }
593         i++;
594     } while (nIndex >= 0);
595 
596     return t;
597 }
598 /* }}} */
599 
600 
601 /* {{{ OResultSet::getTimestamp() -I- */
getTimestamp(sal_Int32 column)602 DateTime SAL_CALL OResultSet::getTimestamp(sal_Int32 column)
603     throw(SQLException, RuntimeException)
604 {
605     OSL_TRACE("OResultSet::getTimestamp");
606     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
607     MutexGuard aGuard(m_aMutex);
608 
609     checkColumnIndex(column);
610     DateTime dt;
611     Date d = getDate(column);
612     Time t = getTime(column);
613 
614     dt.Year = d.Year;
615     dt.Month = d.Month;
616     dt.Day = d.Day;
617     dt.Hours = t.Hours;
618     dt.Minutes = t.Minutes;
619     dt.Seconds = t.Seconds;
620     return dt;
621 }
622 /* }}} */
623 
624 
625 /* {{{ OResultSet::isBeforeFirst() -I- */
isBeforeFirst()626 sal_Bool SAL_CALL OResultSet::isBeforeFirst()
627     throw(SQLException, RuntimeException)
628 {
629     OSL_TRACE("OResultSet::isBeforeFirst");
630     MutexGuard aGuard(m_aMutex);
631     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
632 
633     try {
634         return m_result->isBeforeFirst()? sal_True:sal_False;
635     } catch (sql::SQLException &e) {
636         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
637     }
638     return sal_False; //fool
639 }
640 /* }}} */
641 
642 
643 /* {{{ OResultSet::isAfterLast() -I- */
isAfterLast()644 sal_Bool SAL_CALL OResultSet::isAfterLast()
645     throw(SQLException, RuntimeException)
646 {
647     OSL_TRACE("OResultSet::isAfterLast");
648     MutexGuard aGuard(m_aMutex);
649     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
650 
651     try {
652         return m_result->isAfterLast()? sal_True:sal_False;
653     } catch (sql::SQLException &e) {
654         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
655     }
656     return sal_False; //fool
657 }
658 /* }}} */
659 
660 
661 /* {{{ OResultSet::isFirst() -I- */
isFirst()662 sal_Bool SAL_CALL OResultSet::isFirst()
663     throw(SQLException, RuntimeException)
664 {
665     OSL_TRACE("OResultSet::isFirst");
666     MutexGuard aGuard(m_aMutex);
667     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
668 
669     try {
670         return m_result->isFirst();
671     } catch (sql::SQLException &e) {
672         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
673     }
674     return sal_False; //fool
675 }
676 /* }}} */
677 
678 
679 /* {{{ OResultSet::isLast() -I- */
isLast()680 sal_Bool SAL_CALL OResultSet::isLast()
681     throw(SQLException, RuntimeException)
682 {
683     OSL_TRACE("OResultSet::isLast");
684     MutexGuard aGuard(m_aMutex);
685     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
686 
687     try {
688         return m_result->isLast()? sal_True:sal_False;
689     } catch (sql::SQLException &e) {
690         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
691     }
692     return sal_False; //fool
693 }
694 /* }}} */
695 
696 
697 /* {{{ OResultSet::beforeFirst() -I- */
beforeFirst()698 void SAL_CALL OResultSet::beforeFirst()
699     throw(SQLException, RuntimeException)
700 {
701     OSL_TRACE("OResultSet::beforeFirst");
702     MutexGuard aGuard(m_aMutex);
703     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
704 
705     try {
706         m_result->beforeFirst();
707     } catch (sql::SQLException &e) {
708         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
709     }
710 }
711 /* }}} */
712 
713 
714 /* {{{ OResultSet::afterLast() -I- */
afterLast()715 void SAL_CALL OResultSet::afterLast()
716     throw(SQLException, RuntimeException)
717 {
718     OSL_TRACE("OResultSet::afterLast");
719     MutexGuard aGuard(m_aMutex);
720     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
721 
722     try {
723         m_result->afterLast();
724     } catch (sql::SQLException &e) {
725         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
726     }
727 }
728 /* }}} */
729 
730 
731 /* {{{ OResultSet::close() -I- */
close()732 void SAL_CALL OResultSet::close() throw(SQLException, RuntimeException)
733 {
734     OSL_TRACE("OResultSet::close");
735     MutexGuard aGuard(m_aMutex);
736     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
737 
738     try {
739         m_result->close();
740     } catch (sql::SQLException &e) {
741         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
742     }
743 
744     dispose();
745 }
746 /* }}} */
747 
748 
749 /* {{{ OResultSet::first() -I- */
first()750 sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException)
751 {
752     OSL_TRACE("OResultSet::first");
753     MutexGuard aGuard(m_aMutex);
754     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
755 
756     try {
757         return m_result->first()? sal_True:sal_False;
758     } catch (sql::SQLException &e) {
759         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
760     }
761     return sal_False; //fool
762 }
763 /* }}} */
764 
765 
766 /* {{{ OResultSet::last() -I- */
last()767 sal_Bool SAL_CALL OResultSet::last()
768     throw(SQLException, RuntimeException)
769 {
770     OSL_TRACE("OResultSet::last");
771     MutexGuard aGuard(m_aMutex);
772     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
773 
774     try {
775         return m_result->last()? sal_True:sal_False;
776     } catch (sql::SQLException &e) {
777         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
778     }
779     return sal_False; //fool
780 }
781 /* }}} */
782 
783 
784 /* {{{ OResultSet::absolute() -I- */
absolute(sal_Int32 row)785 sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 row)
786     throw(SQLException, RuntimeException)
787 {
788     OSL_TRACE("OResultSet::absolute");
789     MutexGuard aGuard(m_aMutex);
790     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
791 
792     try {
793         return m_result->absolute(row)? sal_True:sal_False;
794     } catch (sql::SQLException &e) {
795         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
796     }
797     return sal_False; //fool
798 }
799 /* }}} */
800 
801 
802 /* {{{ OResultSet::relative() -I- */
relative(sal_Int32 row)803 sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row)
804     throw(SQLException, RuntimeException)
805 {
806     OSL_TRACE("OResultSet::relative");
807     MutexGuard aGuard(m_aMutex);
808     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
809 
810     try {
811         return m_result->relative(row)? sal_True:sal_False;
812     } catch (sql::SQLException &e) {
813         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
814     }
815     return sal_False; //fool
816 }
817 /* }}} */
818 
819 
820 /* {{{ OResultSet::previous() -I- */
previous()821 sal_Bool SAL_CALL OResultSet::previous()
822     throw(SQLException, RuntimeException)
823 {
824     OSL_TRACE("OResultSet::previous");
825     MutexGuard aGuard(m_aMutex);
826     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
827 
828     try {
829         return m_result->previous()? sal_True:sal_False;
830     } catch (sql::SQLException &e) {
831         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
832     }
833     return sal_False; //fool
834 }
835 /* }}} */
836 
837 
838 /* {{{ OResultSet::getStatement() -I- */
getStatement()839 Reference< XInterface > SAL_CALL OResultSet::getStatement()
840     throw(SQLException, RuntimeException)
841 {
842     OSL_TRACE("OResultSet::getStatement");
843     MutexGuard aGuard(m_aMutex);
844     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
845 
846     return m_aStatement.get();
847 }
848 /* }}} */
849 
850 
851 /* {{{ OResultSet::rowDeleted() -I- */
rowDeleted()852 sal_Bool SAL_CALL OResultSet::rowDeleted()
853     throw(SQLException, RuntimeException)
854 {
855     OSL_TRACE("OResultSet::rowDeleted");
856     MutexGuard aGuard(m_aMutex);
857     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
858 
859     return sal_False;
860 }
861 /* }}} */
862 
863 
864 /* {{{ OResultSet::rowInserted() -I- */
rowInserted()865 sal_Bool SAL_CALL OResultSet::rowInserted()
866     throw(SQLException, RuntimeException)
867 {
868     OSL_TRACE("OResultSet::rowInserted");
869     MutexGuard aGuard(m_aMutex);
870     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
871 
872     return sal_False;
873 }
874 /* }}} */
875 
876 
877 /* {{{ OResultSet::rowUpdated() -I- */
rowUpdated()878 sal_Bool SAL_CALL OResultSet::rowUpdated()
879     throw(SQLException, RuntimeException)
880 {
881     OSL_TRACE("OResultSet::rowUpdated");
882     MutexGuard aGuard(m_aMutex);
883     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
884 
885     return sal_False;
886 }
887 /* }}} */
888 
889 
890 /* {{{ OResultSet::next() -I- */
next()891 sal_Bool SAL_CALL OResultSet::next()
892     throw(SQLException, RuntimeException)
893 {
894     OSL_TRACE("OResultSet::next");
895     MutexGuard aGuard(m_aMutex);
896     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
897 
898     try {
899         return m_result->next()? sal_True:sal_False;
900     } catch (sql::SQLException &e) {
901         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
902     }
903     return sal_False; //fool
904 }
905 /* }}} */
906 
907 
908 /* {{{ OResultSet::wasNull() -I- */
wasNull()909 sal_Bool SAL_CALL OResultSet::wasNull()
910     throw(SQLException, RuntimeException)
911 {
912     OSL_TRACE("OResultSet::wasNull");
913     MutexGuard aGuard(m_aMutex);
914     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
915 
916     try {
917         return m_result->wasNull()? sal_True:sal_False;
918     } catch (sql::SQLException &e) {
919         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
920     }
921     return sal_False; //fool
922 }
923 /* }}} */
924 
925 
926 /* {{{ OResultSet::cancel() -I- */
cancel()927 void SAL_CALL OResultSet::cancel()
928     throw(RuntimeException)
929 {
930     OSL_TRACE("OResultSet::cancel");
931     MutexGuard aGuard(m_aMutex);
932     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
933 }
934 /* }}} */
935 
936 
937 /* {{{ OResultSet::clearWarnings() -I- */
clearWarnings()938 void SAL_CALL OResultSet::clearWarnings()
939     throw(SQLException, RuntimeException)
940 {
941     OSL_TRACE("OResultSet::clearWarnings");
942 }
943 /* }}} */
944 
945 
946 /* {{{ OResultSet::getWarnings() -I- */
getWarnings()947 Any SAL_CALL OResultSet::getWarnings()
948     throw(SQLException, RuntimeException)
949 {
950     OSL_TRACE("OResultSet::getWarnings");
951     Any aRet= Any();
952     return aRet;
953 }
954 /* }}} */
955 
956 
957 /* {{{ OResultSet::insertRow() -I- */
insertRow()958 void SAL_CALL OResultSet::insertRow()
959     throw(SQLException, RuntimeException)
960 {
961     OSL_TRACE("OResultSet::insertRow");
962     MutexGuard aGuard(m_aMutex);
963     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
964     // you only have to implement this if you want to insert new rows
965     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::insertRow", *this);
966 }
967 /* }}} */
968 
969 
970 /* {{{ OResultSet::updateRow() -I- */
updateRow()971 void SAL_CALL OResultSet::updateRow()
972     throw(SQLException, RuntimeException)
973 {
974     OSL_TRACE("OResultSet::updateRow");
975     MutexGuard aGuard(m_aMutex);
976     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
977 
978     // only when you allow updates
979     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateRow", *this);
980 }
981 /* }}} */
982 
983 
984 /* {{{ OResultSet::deleteRow() -I- */
deleteRow()985 void SAL_CALL OResultSet::deleteRow()
986     throw(SQLException, RuntimeException)
987 {
988     OSL_TRACE("OResultSet::deleteRow");
989     MutexGuard aGuard(m_aMutex);
990     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
991     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRow", *this);
992 }
993 /* }}} */
994 
995 
996 /* {{{ OResultSet::cancelRowUpdates() -I- */
cancelRowUpdates()997 void SAL_CALL OResultSet::cancelRowUpdates()
998     throw(SQLException, RuntimeException)
999 {
1000     OSL_TRACE("OResultSet::cancelRowUpdates");
1001     MutexGuard aGuard(m_aMutex);
1002     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1003     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::cancelRowUpdates", *this);
1004 }
1005 /* }}} */
1006 
1007 
1008 /* {{{ OResultSet::moveToInsertRow() -I- */
moveToInsertRow()1009 void SAL_CALL OResultSet::moveToInsertRow()
1010     throw(SQLException, RuntimeException)
1011 {
1012     OSL_TRACE("OResultSet::moveToInsertRow");
1013     MutexGuard aGuard(m_aMutex);
1014     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1015 
1016     // only when you allow insert's
1017     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveToInsertRow", *this);
1018 }
1019 /* }}} */
1020 
1021 
1022 /* {{{ OResultSet::moveToCurrentRow() -I- */
moveToCurrentRow()1023 void SAL_CALL OResultSet::moveToCurrentRow()
1024     throw(SQLException, RuntimeException)
1025 {
1026     OSL_TRACE("OResultSet::moveToCurrentRow");
1027     MutexGuard aGuard(m_aMutex);
1028     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1029 }
1030 /* }}} */
1031 
1032 
1033 /* {{{ OResultSet::updateNull() -U- */
updateNull(sal_Int32 column)1034 void SAL_CALL OResultSet::updateNull(sal_Int32 column)
1035     throw(SQLException, RuntimeException)
1036 {
1037     OSL_TRACE("OResultSet::updateNull");
1038     MutexGuard aGuard(m_aMutex);
1039     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1040     checkColumnIndex(column);
1041     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNull", *this);
1042 }
1043 /* }}} */
1044 
1045 
1046 /* {{{ OResultSet::updateBoolean() -U- */
updateBoolean(sal_Int32 column,sal_Bool)1047 void SAL_CALL OResultSet::updateBoolean(sal_Int32 column, sal_Bool /* x */)
1048     throw(SQLException, RuntimeException)
1049 {
1050     OSL_TRACE("OResultSet::updateBoolean");
1051     MutexGuard aGuard(m_aMutex);
1052     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1053     checkColumnIndex(column);
1054     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBoolean", *this);
1055 }
1056 /* }}} */
1057 
1058 
1059 /* {{{ OResultSet::updateByte() -U- */
updateByte(sal_Int32 column,sal_Int8)1060 void SAL_CALL OResultSet::updateByte(sal_Int32 column, sal_Int8 /* x */)
1061     throw(SQLException, RuntimeException)
1062 {
1063     OSL_TRACE("OResultSet::updateByte");
1064     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1065     MutexGuard aGuard(m_aMutex);
1066     checkColumnIndex(column);
1067     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateByte", *this);
1068 }
1069 /* }}} */
1070 
1071 
1072 /* {{{ OResultSet::updateShort() -U- */
updateShort(sal_Int32 column,sal_Int16)1073 void SAL_CALL OResultSet::updateShort(sal_Int32 column, sal_Int16 /* x */)
1074     throw(SQLException, RuntimeException)
1075 {
1076     OSL_TRACE("OResultSet::updateShort");
1077     MutexGuard aGuard(m_aMutex);
1078     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1079     checkColumnIndex(column);
1080     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateShort", *this);
1081 }
1082 /* }}} */
1083 
1084 
1085 /* {{{ OResultSet::updateInt() -U- */
updateInt(sal_Int32 column,sal_Int32)1086 void SAL_CALL OResultSet::updateInt(sal_Int32 column, sal_Int32 /* x */)
1087     throw(SQLException, RuntimeException)
1088 {
1089     OSL_TRACE("OResultSet::updateInt");
1090     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1091     MutexGuard aGuard(m_aMutex);
1092     checkColumnIndex(column);
1093     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateInt", *this);
1094 }
1095 /* }}} */
1096 
1097 
1098 /* {{{ OResultSet::updateLong() -U- */
updateLong(sal_Int32 column,sal_Int64)1099 void SAL_CALL OResultSet::updateLong(sal_Int32 column, sal_Int64 /* x */)
1100     throw(SQLException, RuntimeException)
1101 {
1102     OSL_TRACE("OResultSet::updateLong");
1103     MutexGuard aGuard(m_aMutex);
1104     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1105     checkColumnIndex(column);
1106     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateLong", *this);
1107 }
1108 /* }}} */
1109 
1110 
1111 /* {{{ OResultSet::updateFloat() -U- */
updateFloat(sal_Int32 column,float)1112 void SAL_CALL OResultSet::updateFloat(sal_Int32 column, float /* x */)
1113     throw(SQLException, RuntimeException)
1114 {
1115     OSL_TRACE("OResultSet::updateFloat");
1116     MutexGuard aGuard(m_aMutex);
1117     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1118     checkColumnIndex(column);
1119     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateFloat", *this);
1120 }
1121 /* }}} */
1122 
1123 
1124 /* {{{ OResultSet::updateDouble() -U- */
updateDouble(sal_Int32 column,double)1125 void SAL_CALL OResultSet::updateDouble(sal_Int32 column, double /* x */)
1126     throw(SQLException, RuntimeException)
1127 {
1128     OSL_TRACE("OResultSet::updateDouble");
1129     MutexGuard aGuard(m_aMutex);
1130     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1131     checkColumnIndex(column);
1132     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDouble", *this);
1133 }
1134 /* }}} */
1135 
1136 
1137 /* {{{ OResultSet::updateString() -U- */
updateString(sal_Int32 column,const OUString &)1138 void SAL_CALL OResultSet::updateString(sal_Int32 column, const OUString& /* x */)
1139     throw(SQLException, RuntimeException)
1140 {
1141     OSL_TRACE("OResultSet::updateString");
1142     MutexGuard aGuard(m_aMutex);
1143     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1144     checkColumnIndex(column);
1145     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateString", *this);
1146 }
1147 /* }}} */
1148 
1149 
1150 /* {{{ OResultSet::updateBytes() -U- */
updateBytes(sal_Int32 column,const Sequence<sal_Int8> &)1151 void SAL_CALL OResultSet::updateBytes(sal_Int32 column, const Sequence< sal_Int8 >& /* x */)
1152     throw(SQLException, RuntimeException)
1153 {
1154     OSL_TRACE("OResultSet::updateBytes");
1155     MutexGuard aGuard(m_aMutex);
1156     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1157     checkColumnIndex(column);
1158     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBytes", *this);
1159 }
1160 /* }}} */
1161 
1162 
1163 /* {{{ OResultSet::updateDate() -U- */
updateDate(sal_Int32 column,const Date &)1164 void SAL_CALL OResultSet::updateDate(sal_Int32 column, const Date& /* x */)
1165     throw(SQLException, RuntimeException)
1166 {
1167     OSL_TRACE("OResultSet::updateDate");
1168     MutexGuard aGuard(m_aMutex);
1169     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1170     checkColumnIndex(column);
1171     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDate", *this);
1172 }
1173 /* }}} */
1174 
1175 
1176 /* {{{ OResultSet::updateTime() -U- */
updateTime(sal_Int32 column,const Time &)1177 void SAL_CALL OResultSet::updateTime(sal_Int32 column, const Time& /* x */)
1178     throw(SQLException, RuntimeException)
1179 {
1180     OSL_TRACE("OResultSet::updateTime");
1181     MutexGuard aGuard(m_aMutex);
1182     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1183     checkColumnIndex(column);
1184     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTime", *this);
1185 }
1186 /* }}} */
1187 
1188 
1189 /* {{{ OResultSet::updateTimestamp() -U- */
updateTimestamp(sal_Int32 column,const DateTime &)1190 void SAL_CALL OResultSet::updateTimestamp(sal_Int32 column, const DateTime& /* x */)
1191     throw(SQLException, RuntimeException)
1192 {
1193     OSL_TRACE("OResultSet::updateTimestamp");
1194     MutexGuard aGuard(m_aMutex);
1195     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1196     checkColumnIndex(column);
1197     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTimestamp", *this);
1198 }
1199 /* }}} */
1200 
1201 
1202 /* {{{ OResultSet::updateBinaryStream() -U- */
updateBinaryStream(sal_Int32 column,const Reference<XInputStream> &,sal_Int32)1203 void SAL_CALL OResultSet::updateBinaryStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1204                                             sal_Int32 /* length */)
1205     throw(SQLException, RuntimeException)
1206 {
1207     OSL_TRACE("OResultSet::updateBinaryStream");
1208     MutexGuard aGuard(m_aMutex);
1209     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1210     checkColumnIndex(column);
1211     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBinaryStream", *this);
1212 }
1213 /* }}} */
1214 
1215 
1216 /* {{{ OResultSet::updateCharacterStream() -U- */
updateCharacterStream(sal_Int32 column,const Reference<XInputStream> &,sal_Int32)1217 void SAL_CALL OResultSet::updateCharacterStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1218                                                 sal_Int32 /* length */)
1219     throw(SQLException, RuntimeException)
1220 {
1221     OSL_TRACE("OResultSet::updateCharacterStream");
1222     MutexGuard aGuard(m_aMutex);
1223     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1224     checkColumnIndex(column);
1225     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateCharacterStream", *this);
1226 }
1227 /* }}} */
1228 
1229 
1230 /* {{{ OResultSet::refreshRow() -U- */
refreshRow()1231 void SAL_CALL OResultSet::refreshRow()
1232     throw(SQLException, RuntimeException)
1233 {
1234     OSL_TRACE("OResultSet::refreshRow");
1235     MutexGuard aGuard(m_aMutex);
1236     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1237     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::refreshRow", *this);
1238 }
1239 /* }}} */
1240 
1241 
1242 /* {{{ OResultSet::updateObject() -U- */
updateObject(sal_Int32 column,const Any &)1243 void SAL_CALL OResultSet::updateObject(sal_Int32 column, const Any& /* x */)
1244     throw(SQLException, RuntimeException)
1245 {
1246     OSL_TRACE("OResultSet::updateObject");
1247     MutexGuard aGuard(m_aMutex);
1248     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1249     checkColumnIndex(column);
1250     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateObject", *this);
1251 }
1252 /* }}} */
1253 
1254 
1255 /* {{{ OResultSet::updateNumericObject() -U- */
updateNumericObject(sal_Int32 column,const Any &,sal_Int32)1256 void SAL_CALL OResultSet::updateNumericObject(sal_Int32 column, const Any& /* x */, sal_Int32 /* scale */)
1257     throw(SQLException, RuntimeException)
1258 {
1259     OSL_TRACE("OResultSet::updateNumericObject");
1260     MutexGuard aGuard(m_aMutex);
1261     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1262     checkColumnIndex(column);
1263     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNumericObject", *this);
1264 }
1265 /* }}} */
1266 
1267 
1268 // XRowLocate
1269 /* {{{ OResultSet::getBookmark() -U- */
getBookmark()1270 Any SAL_CALL OResultSet::getBookmark()
1271     throw(SQLException, RuntimeException)
1272 {
1273     OSL_TRACE("OResultSet::getBookmark");
1274     MutexGuard aGuard(m_aMutex);
1275     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1276     Any aRet = Any();
1277 
1278     // if you don't want to support bookmark you must remove the XRowLocate interface
1279     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBookmark", *this);
1280 
1281     return aRet;
1282 }
1283 /* }}} */
1284 
1285 
1286 /* {{{ OResultSet::moveToBookmark() -U- */
moveToBookmark(const Any &)1287 sal_Bool SAL_CALL OResultSet::moveToBookmark(const Any& /* bookmark */)
1288     throw(SQLException, RuntimeException)
1289 {
1290     OSL_TRACE("OResultSet::moveToBookmark");
1291     MutexGuard aGuard(m_aMutex);
1292     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1293 
1294     return sal_False;
1295 }
1296 /* }}} */
1297 
1298 
1299 /* {{{ OResultSet::moveRelativeToBookmark() -U- */
moveRelativeToBookmark(const Any &,sal_Int32)1300 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark(const Any& /* bookmark */, sal_Int32 /* rows */)
1301     throw(SQLException, RuntimeException)
1302 {
1303     OSL_TRACE("OResultSet::moveRelativeToBookmark");
1304     MutexGuard aGuard(m_aMutex);
1305     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1306 
1307     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveRelativeToBookmark", *this);
1308     return sal_False;
1309 }
1310 /* }}} */
1311 
1312 
1313 /* {{{ OResultSet::compareBookmarks() -I- */
compareBookmarks(const Any &,const Any &)1314 sal_Int32 SAL_CALL OResultSet::compareBookmarks(const Any& /* n1 */, const Any& /* n2 */)
1315     throw(SQLException, RuntimeException)
1316 {
1317     OSL_TRACE("OResultSet::compareBookmarks");
1318     MutexGuard aGuard(m_aMutex);
1319     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1320 
1321     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::compareBookmarks", *this);
1322 
1323     return CompareBookmark::NOT_EQUAL;
1324 }
1325 /* }}} */
1326 
1327 
1328 /* {{{ OResultSet::hasOrderedBookmarks() -I- */
hasOrderedBookmarks()1329 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks()
1330     throw(SQLException, RuntimeException)
1331 {
1332     OSL_TRACE("OResultSet::hasOrderedBookmarks");
1333     return sal_False;
1334 }
1335 /* }}} */
1336 
1337 
1338 /* {{{ OResultSet::hashBookmark() -U- */
hashBookmark(const Any &)1339 sal_Int32 SAL_CALL OResultSet::hashBookmark(const Any& /* bookmark */)
1340     throw(SQLException, RuntimeException)
1341 {
1342     OSL_TRACE("OResultSet::hashBookmark");
1343     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::hashBookmark", *this);
1344     return 0;
1345 }
1346 /* }}} */
1347 
1348 
1349 // XDeleteRows
1350 /* {{{ OResultSet::deleteRows() -U- */
deleteRows(const Sequence<Any> &)1351 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows(const Sequence< Any >& /* rows */)
1352     throw(SQLException, RuntimeException)
1353 {
1354     OSL_TRACE("OResultSet::deleteRows");
1355     MutexGuard aGuard(m_aMutex);
1356     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1357     Sequence< sal_Int32 > aRet = Sequence< sal_Int32 >();
1358 
1359     mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRows", *this);
1360     return aRet;
1361 }
1362 /* }}} */
1363 
1364 
1365 /* {{{ OResultSet::createArrayHelper() -I- */
createArrayHelper() const1366 IPropertyArrayHelper * OResultSet::createArrayHelper() const
1367 {
1368     OSL_TRACE("OResultSet::createArrayHelper");
1369     Sequence< Property > aProps(5);
1370     Property* pProperties = aProps.getArray();
1371     sal_Int32 nPos = 0;
1372     DECL_PROP0(FETCHDIRECTION,          sal_Int32);
1373     DECL_PROP0(FETCHSIZE,               sal_Int32);
1374     DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
1375     DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
1376     DECL_PROP1IMPL(RESULTSETTYPE,       sal_Int32) PropertyAttribute::READONLY);
1377 
1378     return new OPropertyArrayHelper(aProps);
1379 }
1380 /* }}} */
1381 
1382 
1383 /* {{{ OResultSet::getInfoHelper() -I- */
getInfoHelper()1384 IPropertyArrayHelper & OResultSet::getInfoHelper()
1385 {
1386     OSL_TRACE("OResultSet::getInfoHelper");
1387     return (*const_cast<OResultSet*>(this)->getArrayHelper());
1388 }
1389 /* }}} */
1390 
1391 
1392 /* {{{ OResultSet::convertFastPropertyValue() -I- */
convertFastPropertyValue(Any &,Any &,sal_Int32 nHandle,const Any &)1393 sal_Bool OResultSet::convertFastPropertyValue(Any & /* rConvertedValue */,
1394                                             Any & /* rOldValue */,
1395                                             sal_Int32 nHandle,
1396                                             const Any& /* rValue */)
1397     throw (::com::sun::star::lang::IllegalArgumentException)
1398 {
1399     OSL_TRACE("OResultSet::convertFastPropertyValue");
1400     switch (nHandle) {
1401         case PROPERTY_ID_ISBOOKMARKABLE:
1402         case PROPERTY_ID_CURSORNAME:
1403         case PROPERTY_ID_RESULTSETCONCURRENCY:
1404         case PROPERTY_ID_RESULTSETTYPE:
1405             throw ::com::sun::star::lang::IllegalArgumentException();
1406         case PROPERTY_ID_FETCHDIRECTION:
1407         case PROPERTY_ID_FETCHSIZE:
1408         default:
1409             ;
1410     }
1411     return sal_False;
1412 }
1413 /* }}} */
1414 
1415 
1416 /* {{{ OResultSet::setFastPropertyValue_NoBroadcast() -I- */
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any &)1417 void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& /* rValue */)
1418     throw (Exception)
1419 {
1420     OSL_TRACE("OResultSet::setFastPropertyValue_NoBroadcast");
1421     switch (nHandle) {
1422         case PROPERTY_ID_ISBOOKMARKABLE:
1423         case PROPERTY_ID_CURSORNAME:
1424         case PROPERTY_ID_RESULTSETCONCURRENCY:
1425         case PROPERTY_ID_RESULTSETTYPE:
1426             throw Exception();
1427         case PROPERTY_ID_FETCHDIRECTION:
1428             break;
1429         case PROPERTY_ID_FETCHSIZE:
1430             break;
1431         default:
1432             ;
1433     }
1434 }
1435 /* }}} */
1436 
1437 
1438 /* {{{ OResultSet::getFastPropertyValue() -I- */
getFastPropertyValue(Any & _rValue,sal_Int32 nHandle) const1439 void OResultSet::getFastPropertyValue(Any& _rValue, sal_Int32 nHandle) const
1440 {
1441     OSL_TRACE("OResultSet::getFastPropertyValue");
1442     switch (nHandle) {
1443         case PROPERTY_ID_ISBOOKMARKABLE:
1444             _rValue <<= sal_False;
1445             break;
1446         case PROPERTY_ID_CURSORNAME:
1447             break;
1448         case PROPERTY_ID_RESULTSETCONCURRENCY:
1449             _rValue <<= ResultSetConcurrency::READ_ONLY;
1450             break;
1451         case PROPERTY_ID_RESULTSETTYPE:
1452             _rValue <<= ResultSetType::SCROLL_INSENSITIVE;
1453             break;
1454         case PROPERTY_ID_FETCHDIRECTION:
1455             _rValue <<= FetchDirection::FORWARD;
1456             break;
1457         case PROPERTY_ID_FETCHSIZE:
1458             _rValue <<= sal_Int32(50);
1459             break;
1460             ;
1461         default:
1462             ;
1463     }
1464 }
1465 /* }}} */
1466 
1467 
1468 /* {{{ OResultSet::acquire() -I- */
acquire()1469 void SAL_CALL OResultSet::acquire()
1470     throw()
1471 {
1472     OSL_TRACE("OResultSet::acquire");
1473     OResultSet_BASE::acquire();
1474 }
1475 /* }}} */
1476 
1477 
1478 /* {{{ OResultSet::release() -I- */
release()1479 void SAL_CALL OResultSet::release()
1480     throw()
1481 {
1482     OSL_TRACE("OResultSet::release");
1483     OResultSet_BASE::release();
1484 }
1485 /* }}} */
1486 
1487 
1488 /* {{{ OResultSet::getPropertySetInfo() -I- */
getPropertySetInfo()1489 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
1490 {
1491     OSL_TRACE("OResultSet::getPropertySetInfo");
1492     return (::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()));
1493 }
1494 /* }}} */
1495 
1496 
1497 /* {{{ OResultSet::checkColumnIndex() -I- */
checkColumnIndex(sal_Int32 index)1498 void OResultSet::checkColumnIndex(sal_Int32 index)
1499     throw (SQLException, RuntimeException)
1500 {
1501     OSL_TRACE("OResultSet::checkColumnIndex");
1502     if ((index < 1 || index > (int) fieldCount)) {
1503         /* static object for efficiency or thread safety is a problem ? */
1504         OUString buf( RTL_CONSTASCII_USTRINGPARAM( "index out of range" ) );
1505         throw SQLException(buf, *this, OUString(), 1, Any());
1506     }
1507 }
1508 /* }}} */
1509 
1510 
1511 /*
1512  * Local variables:
1513  * tab-width: 4
1514  * c-basic-offset: 4
1515  * End:
1516  * vim600: noet sw=4 ts=4 fdm=marker
1517  * vim<600: noet sw=4 ts=4
1518  */
1519