Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <sal/macros.h>
21 : #include "java/sql/DatabaseMetaData.hxx"
22 : #include "java/sql/Connection.hxx"
23 : #include "java/sql/ResultSet.hxx"
24 : #include "java/tools.hxx"
25 : #include "java/lang/String.hxx"
26 : #include <connectivity/CommonTools.hxx>
27 : #include "FDatabaseMetaDataResultSet.hxx"
28 : #include <comphelper/types.hxx>
29 : #include "TPrivilegesResultSet.hxx"
30 : #include "diagnose_ex.h"
31 : #include "resource/jdbc_log.hrc"
32 :
33 : using namespace ::comphelper;
34 :
35 : using namespace connectivity;
36 : using namespace ::com::sun::star::uno;
37 : using namespace ::com::sun::star::beans;
38 : using namespace ::com::sun::star::sdbc;
39 : using namespace ::com::sun::star::container;
40 : using namespace ::com::sun::star::lang;
41 :
42 : jclass java_sql_DatabaseMetaData::theClass = 0;
43 :
44 6 : java_sql_DatabaseMetaData::~java_sql_DatabaseMetaData()
45 : {
46 2 : SDBThreadAttach::releaseRef();
47 4 : }
48 :
49 40 : jclass java_sql_DatabaseMetaData::getMyClass() const
50 : {
51 : // the class must be fetched only once, therefore static
52 40 : if( !theClass )
53 4 : theClass = findMyClass("java/sql/DatabaseMetaData");
54 40 : return theClass;
55 : }
56 :
57 4 : java_sql_DatabaseMetaData::java_sql_DatabaseMetaData( JNIEnv * pEnv, jobject myObj, java_sql_Connection& _rConnection )
58 4 : :ODatabaseMetaDataBase( &_rConnection,_rConnection.getConnectionInfo() )
59 : ,java_lang_Object( pEnv, myObj )
60 : ,m_pConnection( &_rConnection )
61 4 : ,m_aLogger( _rConnection.getLogger() )
62 : {
63 4 : SDBThreadAttach::addRef();
64 4 : }
65 :
66 :
67 0 : Reference< XResultSet > java_sql_DatabaseMetaData::impl_getTypeInfo_throw( )
68 : {
69 : static jmethodID mID(NULL);
70 0 : return impl_callResultSetMethod( "getTypeInfo", mID );
71 : }
72 :
73 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException, std::exception)
74 : {
75 : static jmethodID mID(NULL);
76 0 : return impl_callResultSetMethod( "getCatalogs", mID );
77 : }
78 :
79 2 : OUString java_sql_DatabaseMetaData::impl_getCatalogSeparator_throw( )
80 : {
81 : static jmethodID mID(NULL);
82 2 : return impl_callStringMethod( "getCatalogSeparator", mID );
83 : }
84 :
85 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException, std::exception)
86 : {
87 : static jmethodID mID(NULL);
88 0 : return impl_callResultSetMethod( "getSchemas", mID );
89 : }
90 :
91 2 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumnPrivileges(
92 : const Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) throw(SQLException, RuntimeException, std::exception)
93 : {
94 : static jmethodID mID(NULL);
95 2 : return impl_callResultSetMethodWithStrings( "getColumnPrivileges", mID, catalog, schema, table, &columnNamePattern );
96 : }
97 :
98 2 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumns(
99 : const Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) throw(SQLException, RuntimeException, std::exception)
100 : {
101 : static jmethodID mID(NULL);
102 2 : return impl_callResultSetMethodWithStrings( "getColumns", mID, catalog, schemaPattern, tableNamePattern, &columnNamePattern );
103 : }
104 :
105 :
106 8 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables(
107 : const Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const Sequence< OUString >& _types ) throw(SQLException, RuntimeException, std::exception)
108 : {
109 : static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;";
110 : static const char * cMethodName = "getTables";
111 :
112 8 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
113 :
114 8 : jobject out(0);
115 8 : SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
116 :
117 : {
118 : // execute Java-Call
119 : static jmethodID mID(NULL);
120 8 : obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
121 8 : OSL_VERIFY_RES( !isExceptionOccurred(t.pEnv, true),"Exception occurred!");
122 : jvalue args[4];
123 :
124 8 : args[3].l = 0;
125 8 : sal_Int32 typeFilterCount = _types.getLength();
126 8 : if ( typeFilterCount )
127 : {
128 8 : jobjectArray pObjArray = static_cast< jobjectArray >( t.pEnv->NewObjectArray( (jsize)typeFilterCount, java_lang_String::st_getMyClass(), 0 ) );
129 8 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
130 8 : const OUString* typeFilter = _types.getConstArray();
131 8 : bool bIncludeAllTypes = false;
132 24 : for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter )
133 : {
134 20 : if ( *typeFilter == "%" )
135 : {
136 4 : bIncludeAllTypes = true;
137 4 : break;
138 : }
139 16 : jstring aT = convertwchar_tToJavaString( t.pEnv, *typeFilter );
140 16 : t.pEnv->SetObjectArrayElement( pObjArray, (jsize)i, aT );
141 16 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
142 : }
143 :
144 8 : if ( bIncludeAllTypes )
145 : {
146 : // the SDBC API allows to pass "%" as table type filter, but in JDBC, "all table types"
147 : // is represented by the table type being <null/>
148 4 : t.pEnv->DeleteLocalRef( pObjArray );
149 4 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
150 : }
151 : else
152 : {
153 4 : args[3].l = pObjArray;
154 : }
155 : }
156 : // if we are to display "all catalogs", then respect m_aCatalogRestriction
157 8 : Any aCatalogFilter( catalog );
158 8 : if ( !aCatalogFilter.hasValue() )
159 8 : aCatalogFilter = m_pConnection->getCatalogRestriction();
160 : // similar for schema
161 16 : Any aSchemaFilter;
162 8 : if ( schemaPattern == "%" )
163 4 : aSchemaFilter = m_pConnection->getSchemaRestriction();
164 : else
165 4 : aSchemaFilter <<= schemaPattern;
166 :
167 8 : args[0].l = aCatalogFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aCatalogFilter ) ) : NULL;
168 8 : args[1].l = aSchemaFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aSchemaFilter ) ) : NULL;
169 8 : args[2].l = convertwchar_tToJavaString(t.pEnv,tableNamePattern);
170 8 : out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
171 8 : jthrowable jThrow = t.pEnv->ExceptionOccurred();
172 8 : if ( jThrow )
173 0 : t.pEnv->ExceptionClear();// we have to clear the exception here because we want to handle it below
174 8 : if ( aCatalogFilter.hasValue() )
175 : {
176 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l));
177 0 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
178 : }
179 8 : if(args[1].l)
180 : {
181 4 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l));
182 4 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
183 : }
184 8 : if(!tableNamePattern.isEmpty())
185 : {
186 8 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l));
187 8 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
188 : }
189 : //for(INT16 i=0;i<len;i++)
190 8 : if ( args[3].l )
191 : {
192 4 : t.pEnv->DeleteLocalRef( static_cast<jobjectArray>(args[3].l) );
193 4 : OSL_VERIFY_RES( !isExceptionOccurred( t.pEnv, true ), "Exception occurred!" );
194 : }
195 :
196 8 : if ( jThrow )
197 : {
198 0 : if ( t.pEnv->IsInstanceOf( jThrow,java_sql_SQLException_BASE::st_getMyClass() ) )
199 : {
200 0 : java_sql_SQLException_BASE* pException = new java_sql_SQLException_BASE( t.pEnv, jThrow );
201 : SQLException e( pException->getMessage(),
202 : *this,
203 : pException->getSQLState(),
204 0 : pException->getErrorCode(),
205 : Any()
206 0 : );
207 0 : delete pException;
208 0 : throw e;
209 : }
210 8 : }
211 : }
212 :
213 8 : if ( !out )
214 0 : return NULL;
215 :
216 8 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
217 8 : return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
218 : }
219 :
220 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedureColumns(
221 : const Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) throw(SQLException, RuntimeException, std::exception)
222 : {
223 : static jmethodID mID(NULL);
224 0 : return impl_callResultSetMethodWithStrings( "getProcedureColumns", mID, catalog, schemaPattern, procedureNamePattern, &columnNamePattern );
225 : }
226 :
227 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedures( const Any&
228 : catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) throw(SQLException, RuntimeException, std::exception)
229 : {
230 : static jmethodID mID(NULL);
231 0 : return impl_callResultSetMethodWithStrings( "getProcedures", mID, catalog, schemaPattern, procedureNamePattern );
232 : }
233 :
234 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getVersionColumns(
235 : const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException, std::exception)
236 : {
237 : static jmethodID mID(NULL);
238 0 : return impl_callResultSetMethodWithStrings( "getVersionColumns", mID, catalog, schema, table );
239 : }
240 :
241 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
242 : {
243 : static jmethodID mID(NULL);
244 0 : return impl_callIntMethod_ThrowSQL("getMaxBinaryLiteralLength", mID);
245 : }
246 :
247 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException, std::exception)
248 : {
249 : static jmethodID mID(NULL);
250 0 : return impl_callIntMethod_ThrowSQL("getMaxRowSize", mID);
251 : }
252 :
253 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException, std::exception)
254 : {
255 : static jmethodID mID(NULL);
256 0 : return impl_callIntMethod_ThrowSQL("getMaxCatalogNameLength", mID);
257 : }
258 :
259 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
260 : {
261 : static jmethodID mID(NULL);
262 0 : return impl_callIntMethod_ThrowSQL("getMaxCharLiteralLength", mID);
263 : }
264 :
265 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException, std::exception)
266 : {
267 : static jmethodID mID(NULL);
268 0 : return impl_callIntMethod_ThrowSQL("getMaxColumnNameLength", mID);
269 : }
270 :
271 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException, std::exception)
272 : {
273 : static jmethodID mID(NULL);
274 0 : return impl_callIntMethod_ThrowSQL("getMaxColumnsInIndex", mID);
275 : }
276 :
277 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException, std::exception)
278 : {
279 : static jmethodID mID(NULL);
280 0 : return impl_callIntMethod_ThrowSQL("getMaxCursorNameLength", mID);
281 : }
282 :
283 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException, std::exception)
284 : {
285 : static jmethodID mID(NULL);
286 0 : return impl_callIntMethod_ThrowSQL("getMaxConnections", mID);
287 : }
288 :
289 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException, std::exception)
290 : {
291 : static jmethodID mID(NULL);
292 0 : return impl_callIntMethod_ThrowSQL("getMaxColumnsInTable", mID);
293 : }
294 :
295 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException, std::exception)
296 : {
297 : static jmethodID mID(NULL);
298 0 : return impl_callIntMethod_ThrowSQL("getMaxStatementLength", mID);
299 : }
300 :
301 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException, std::exception)
302 : {
303 : static jmethodID mID(NULL);
304 0 : return impl_callIntMethod_ThrowSQL("getMaxTableNameLength", mID);
305 : }
306 :
307 4 : sal_Int32 java_sql_DatabaseMetaData::impl_getMaxTablesInSelect_throw( )
308 : {
309 : static jmethodID mID(NULL);
310 4 : return impl_callIntMethod_ThrowSQL("getMaxTablesInSelect", mID);
311 : }
312 :
313 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getExportedKeys(
314 : const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException, std::exception)
315 : {
316 : static jmethodID mID(NULL);
317 0 : return impl_callResultSetMethodWithStrings( "getExportedKeys", mID, catalog, schema, table );
318 : }
319 :
320 2 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getImportedKeys(
321 : const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException, std::exception)
322 : {
323 : static jmethodID mID(NULL);
324 2 : return impl_callResultSetMethodWithStrings( "getImportedKeys", mID, catalog, schema, table );
325 : }
326 :
327 2 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getPrimaryKeys(
328 : const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException, std::exception)
329 : {
330 : static jmethodID mID(NULL);
331 2 : return impl_callResultSetMethodWithStrings( "getPrimaryKeys", mID, catalog, schema, table );
332 : }
333 :
334 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getIndexInfo(
335 : const Any& catalog, const OUString& schema, const OUString& table,
336 : sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException, std::exception)
337 : {
338 : static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/sql/ResultSet;";
339 : static const char * cMethodName = "getIndexInfo";
340 :
341 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
342 :
343 0 : jobject out(0);
344 0 : SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
345 :
346 : {
347 : // execute Java-Call
348 : static jmethodID mID(NULL);
349 0 : obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
350 : jvalue args[5];
351 : // convert Parameter
352 0 : args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
353 0 : args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
354 0 : args[2].l = convertwchar_tToJavaString(t.pEnv,table);
355 0 : args[3].z = unique;
356 0 : args[4].z = approximate;
357 0 : out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,args[3].z,args[4].z );
358 :
359 : // and clean up
360 0 : if(catalog.hasValue())
361 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l));
362 0 : if(args[1].l)
363 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l));
364 0 : if(!table.isEmpty())
365 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l));
366 0 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
367 : }
368 0 : if ( !out )
369 0 : return NULL;
370 :
371 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
372 0 : return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
373 : }
374 :
375 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getBestRowIdentifier(
376 : const Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope,
377 : sal_Bool nullable ) throw(SQLException, RuntimeException, std::exception)
378 : {
379 : static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)Ljava/sql/ResultSet;";
380 : static const char * cMethodName = "getBestRowIdentifier";
381 :
382 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
383 :
384 0 : jobject out(0);
385 0 : SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
386 :
387 : {
388 : // execute Java-Call
389 : static jmethodID mID(NULL);
390 0 : obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
391 : jvalue args[3];
392 : // convert Parameter
393 0 : args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
394 0 : args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
395 0 : args[2].l = convertwchar_tToJavaString(t.pEnv,table);
396 0 : out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,scope,nullable);
397 :
398 : // and cleanup
399 0 : if(catalog.hasValue())
400 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l));
401 0 : if(args[1].l)
402 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l));
403 0 : if(!table.isEmpty())
404 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l));
405 0 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
406 : }
407 :
408 0 : if ( !out )
409 0 : return NULL;
410 :
411 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
412 0 : return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
413 : }
414 :
415 2 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
416 : const Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) throw(SQLException, RuntimeException, std::exception)
417 : {
418 2 : if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
419 2 : return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
420 :
421 : static jmethodID mID(NULL);
422 0 : Reference< XResultSet > xReturn( impl_callResultSetMethodWithStrings( "getTablePrivileges", mID, catalog, schemaPattern, tableNamePattern ) );
423 :
424 0 : if ( xReturn.is() )
425 : {
426 : // we have to check the result columns for the tables privleges
427 0 : Reference< XResultSetMetaDataSupplier > xMetaSup(xReturn,UNO_QUERY);
428 0 : if ( xMetaSup.is() )
429 : {
430 0 : Reference< XResultSetMetaData> xMeta = xMetaSup->getMetaData();
431 0 : if ( xMeta.is() && xMeta->getColumnCount() != 7 )
432 : {
433 : // here we know that the count of column doesn't match
434 0 : ::std::map<sal_Int32,sal_Int32> aColumnMatching;
435 : static const OUString sPrivs[] = {
436 : OUString("TABLE_CAT"),
437 : OUString("TABLE_SCHEM"),
438 : OUString("TABLE_NAME"),
439 : OUString("GRANTOR"),
440 : OUString("GRANTEE"),
441 : OUString("PRIVILEGE"),
442 : OUString("IS_GRANTABLE")
443 0 : };
444 :
445 0 : OUString sColumnName;
446 0 : sal_Int32 nCount = xMeta->getColumnCount();
447 0 : for (sal_Int32 i = 1 ; i <= nCount ; ++i)
448 : {
449 0 : sColumnName = xMeta->getColumnName(i);
450 0 : for (sal_uInt32 j = 0 ; j < sizeof(sPrivs)/sizeof(sPrivs[0]); ++j)
451 : {
452 0 : if ( sPrivs[j] == sColumnName )
453 : {
454 0 : aColumnMatching.insert( ::std::map<sal_Int32,sal_Int32>::value_type(i,j+1) );
455 0 : break;
456 : }
457 : }
458 :
459 : }
460 : // fill our own resultset
461 0 : ODatabaseMetaDataResultSet* pNewPrivRes = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
462 0 : Reference< XResultSet > xTemp = xReturn;
463 0 : xReturn = pNewPrivRes;
464 0 : ODatabaseMetaDataResultSet::ORows aRows;
465 0 : Reference< XRow > xRow(xTemp,UNO_QUERY);
466 0 : OUString sValue;
467 :
468 0 : ODatabaseMetaDataResultSet::ORow aRow(8);
469 0 : while ( xRow.is() && xTemp->next() )
470 : {
471 0 : ::std::map<sal_Int32,sal_Int32>::iterator aIter = aColumnMatching.begin();
472 0 : ::std::map<sal_Int32,sal_Int32>::iterator aEnd = aColumnMatching.end();
473 0 : for (;aIter != aEnd ; ++aIter)
474 : {
475 0 : sValue = xRow->getString(aIter->first);
476 0 : if ( xRow->wasNull() )
477 0 : aRow[aIter->second] = ODatabaseMetaDataResultSet::getEmptyValue();
478 : else
479 0 : aRow[aIter->second] = new ORowSetValueDecorator(sValue);
480 : }
481 :
482 0 : aRows.push_back(aRow);
483 : }
484 0 : pNewPrivRes->setRows(aRows);
485 0 : }
486 0 : }
487 : }
488 0 : return xReturn;
489 : }
490 :
491 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference(
492 : const Any& primaryCatalog, const OUString& primarySchema,
493 : const OUString& primaryTable, const Any& foreignCatalog,
494 : const OUString& foreignSchema, const OUString& foreignTable ) throw(SQLException, RuntimeException, std::exception)
495 : {
496 : static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
497 : static const char * cMethodName = "getCrossReference";
498 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
499 :
500 0 : jobject out(0);
501 0 : SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
502 : {
503 :
504 : // execute Java-Call
505 : static jmethodID mID(NULL);
506 0 : obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
507 : jvalue args[6];
508 : // convert Parameter
509 0 : args[0].l = primaryCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(primaryCatalog)) : 0;
510 0 : args[1].l = primarySchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,primarySchema);
511 0 : args[2].l = convertwchar_tToJavaString(t.pEnv,primaryTable);
512 0 : args[3].l = foreignCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(foreignCatalog)) : 0;
513 0 : args[4].l = foreignSchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,foreignSchema);
514 0 : args[5].l = convertwchar_tToJavaString(t.pEnv,foreignTable);
515 0 : out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[2].l,args[2].l,args[3].l,args[4].l,args[5].l );
516 :
517 : // and clean up
518 0 : if(primaryCatalog.hasValue())
519 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l));
520 0 : if(args[1].l)
521 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l));
522 0 : if(!primaryTable.isEmpty())
523 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l));
524 0 : if(foreignCatalog.hasValue())
525 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[3].l));
526 0 : if(args[4].l)
527 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[4].l));
528 0 : if(!foreignTable.isEmpty())
529 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[5].l));
530 0 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
531 : }
532 :
533 0 : if ( !out )
534 0 : return NULL;
535 :
536 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
537 0 : return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
538 : }
539 :
540 :
541 14 : bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
542 : {
543 14 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
544 14 : jboolean out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) );
545 14 : m_aLogger.log< const sal_Char*, sal_Int16>( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
546 14 : return out;
547 : }
548 :
549 :
550 8 : OUString java_sql_DatabaseMetaData::impl_callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
551 : {
552 8 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
553 :
554 8 : const OUString sReturn( callStringMethod(_pMethodName,_inout_MethodID) );
555 8 : if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
556 : {
557 0 : OUString sLoggedResult( sReturn );
558 0 : if ( sLoggedResult.isEmpty() )
559 0 : sLoggedResult = "<empty string>";
560 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, sLoggedResult );
561 : }
562 :
563 8 : return sReturn;
564 : }
565 :
566 4 : sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod_ThrowSQL(const char* _pMethodName, jmethodID& _inout_MethodID)
567 : {
568 4 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
569 4 : sal_Int32 out( (sal_Int32)callIntMethod_ThrowSQL(_pMethodName,_inout_MethodID) );
570 4 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, (sal_Int32)out );
571 4 : return out;
572 : }
573 :
574 0 : sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod_ThrowRuntime(const char* _pMethodName, jmethodID& _inout_MethodID)
575 : {
576 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
577 0 : sal_Int32 out( (sal_Int32)callIntMethod_ThrowRuntime(_pMethodName,_inout_MethodID) );
578 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, (sal_Int32)out );
579 0 : return out;
580 : }
581 :
582 0 : bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument )
583 : {
584 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG1, _pMethodName, _nArgument );
585 :
586 0 : jboolean out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) );
587 :
588 0 : m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
589 0 : return out;
590 : }
591 :
592 :
593 4 : Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
594 : {
595 4 : SDBThreadAttach t;
596 4 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
597 4 : jobject out(callResultSetMethod(t.env(),_pMethodName,_inout_MethodID));
598 4 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
599 4 : return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
600 : }
601 :
602 :
603 8 : Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings( const char* _pMethodName, jmethodID& _inout_MethodID,
604 : const Any& _rCatalog, const OUString& _rSchemaPattern, const OUString& _rLeastPattern,
605 : const OUString* _pOptionalAdditionalString )
606 : {
607 8 : bool bCatalog = _rCatalog.hasValue();
608 8 : OUString sCatalog;
609 8 : _rCatalog >>= sCatalog;
610 :
611 8 : bool bSchema = _rSchemaPattern.toChar() != '%';
612 :
613 : // log the call
614 8 : if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
615 : {
616 0 : OUString sCatalogLog = bCatalog ? sCatalog : OUString( "null" );
617 0 : OUString sSchemaLog = bSchema ? _rSchemaPattern : OUString( "null" );
618 0 : if ( _pOptionalAdditionalString )
619 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG4, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern, *_pOptionalAdditionalString );
620 : else
621 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG3, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern );
622 : }
623 :
624 8 : jobject out(0);
625 :
626 16 : SDBThreadAttach t;
627 : OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: no Java environment anymore!" );
628 :
629 : {
630 : const char* pSignature = _pOptionalAdditionalString
631 : ? "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;"
632 8 : : "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
633 : // obtain method ID
634 8 : obtainMethodId_throwSQL(t.pEnv, _pMethodName,pSignature, _inout_MethodID);
635 :
636 : // call method
637 :
638 : {
639 : jvalue args[4];
640 : // convert parameters
641 8 : args[0].l = bCatalog ? convertwchar_tToJavaString( t.pEnv, sCatalog ) : NULL;
642 8 : args[1].l = bSchema ? convertwchar_tToJavaString( t.pEnv, _rSchemaPattern ) : NULL;
643 8 : args[2].l = convertwchar_tToJavaString( t.pEnv, _rLeastPattern );
644 8 : args[3].l = _pOptionalAdditionalString ? convertwchar_tToJavaString( t.pEnv, *_pOptionalAdditionalString ) : NULL;
645 :
646 : // actually do the call
647 8 : if ( _pOptionalAdditionalString )
648 4 : out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l, args[3].l );
649 : else
650 4 : out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l );
651 :
652 : // clean up
653 8 : if ( args[0].l )
654 0 : t.pEnv->DeleteLocalRef( static_cast<jstring>(args[0].l) );
655 8 : if ( args[1].l )
656 8 : t.pEnv->DeleteLocalRef( static_cast<jstring>(args[1].l) );
657 8 : if ( args[2].l )
658 8 : t.pEnv->DeleteLocalRef( static_cast<jstring>(args[2].l) );
659 8 : if ( args[3].l )
660 4 : t.pEnv->DeleteLocalRef( static_cast<jstring>(args[3].l) );
661 :
662 8 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
663 : }
664 : }
665 :
666 8 : if ( !out )
667 0 : return NULL;
668 :
669 8 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
670 16 : return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
671 : }
672 :
673 :
674 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException, std::exception)
675 : {
676 : static jmethodID mID(NULL);
677 0 : return impl_callBooleanMethod( "doesMaxRowSizeIncludeBlobs", mID );
678 : }
679 :
680 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
681 : {
682 : static jmethodID mID(NULL);
683 0 : return impl_callBooleanMethod( "storesLowerCaseQuotedIdentifiers", mID );
684 : }
685 :
686 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
687 : {
688 : static jmethodID mID(NULL);
689 0 : return impl_callBooleanMethod( "storesLowerCaseIdentifiers", mID );
690 : }
691 :
692 0 : bool java_sql_DatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
693 : {
694 : static jmethodID mID(NULL);
695 0 : return impl_callBooleanMethod( "storesMixedCaseQuotedIdentifiers", mID );
696 : }
697 :
698 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
699 : {
700 : static jmethodID mID(NULL);
701 0 : return impl_callBooleanMethod( "storesMixedCaseIdentifiers", mID );
702 : }
703 :
704 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
705 : {
706 : static jmethodID mID(NULL);
707 0 : return impl_callBooleanMethod( "storesUpperCaseQuotedIdentifiers", mID );
708 : }
709 :
710 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
711 : {
712 : static jmethodID mID(NULL);
713 0 : return impl_callBooleanMethod( "storesUpperCaseIdentifiers", mID );
714 : }
715 :
716 2 : bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
717 : {
718 : static jmethodID mID(NULL);
719 2 : return impl_callBooleanMethod( "supportsAlterTableWithAddColumn", mID );
720 : }
721 :
722 2 : bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
723 : {
724 : static jmethodID mID(NULL);
725 2 : return impl_callBooleanMethod( "supportsAlterTableWithDropColumn", mID );
726 : }
727 :
728 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException, std::exception)
729 : {
730 : static jmethodID mID(NULL);
731 0 : return impl_callIntMethod_ThrowSQL("getMaxIndexLength", mID);
732 : }
733 :
734 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException, std::exception)
735 : {
736 : static jmethodID mID(NULL);
737 0 : return impl_callBooleanMethod( "supportsNonNullableColumns", mID );
738 : }
739 :
740 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException, std::exception)
741 : {
742 : static jmethodID mID(NULL);
743 0 : return impl_callStringMethod( "getCatalogTerm", mID );
744 : }
745 :
746 2 : OUString java_sql_DatabaseMetaData::impl_getIdentifierQuoteString_throw( )
747 : {
748 : static jmethodID mID(NULL);
749 2 : return impl_callStringMethod( "getIdentifierQuoteString", mID );
750 : }
751 :
752 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException, std::exception)
753 : {
754 : static jmethodID mID(NULL);
755 0 : return impl_callStringMethod( "getExtraNameCharacters", mID );
756 : }
757 :
758 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException, std::exception)
759 : {
760 : static jmethodID mID(NULL);
761 0 : return impl_callBooleanMethod( "supportsDifferentTableCorrelationNames", mID );
762 : }
763 :
764 0 : bool java_sql_DatabaseMetaData::impl_isCatalogAtStart_throw( )
765 : {
766 : static jmethodID mID(NULL);
767 0 : return impl_callBooleanMethod( "isCatalogAtStart", mID );
768 : }
769 :
770 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException, std::exception)
771 : {
772 : static jmethodID mID(NULL);
773 0 : return impl_callBooleanMethod( "dataDefinitionIgnoredInTransactions", mID );
774 : }
775 :
776 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException, std::exception)
777 : {
778 : static jmethodID mID(NULL);
779 0 : return impl_callBooleanMethod( "dataDefinitionCausesTransactionCommit", mID );
780 : }
781 :
782 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException, std::exception)
783 : {
784 : static jmethodID mID(NULL);
785 0 : return impl_callBooleanMethod( "supportsDataManipulationTransactionsOnly", mID );
786 : }
787 :
788 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException, std::exception)
789 : {
790 : static jmethodID mID(NULL);
791 0 : return impl_callBooleanMethod( "supportsDataDefinitionAndDataManipulationTransactions", mID );
792 : }
793 :
794 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException, std::exception)
795 : {
796 : static jmethodID mID(NULL);
797 0 : return impl_callBooleanMethod( "supportsPositionedDelete", mID );
798 : }
799 :
800 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException, std::exception)
801 : {
802 : static jmethodID mID(NULL);
803 0 : return impl_callBooleanMethod( "supportsPositionedUpdate", mID );
804 : }
805 :
806 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException, std::exception)
807 : {
808 : static jmethodID mID(NULL);
809 0 : return impl_callBooleanMethod( "supportsOpenStatementsAcrossRollback", mID );
810 : }
811 :
812 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException, std::exception)
813 : {
814 : static jmethodID mID(NULL);
815 0 : return impl_callBooleanMethod( "supportsOpenStatementsAcrossCommit", mID );
816 : }
817 :
818 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException, std::exception)
819 : {
820 : static jmethodID mID(NULL);
821 0 : return impl_callBooleanMethod( "supportsOpenCursorsAcrossCommit", mID );
822 : }
823 :
824 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException, std::exception)
825 : {
826 : static jmethodID mID(NULL);
827 0 : return impl_callBooleanMethod( "supportsOpenCursorsAcrossRollback", mID );
828 : }
829 :
830 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException, std::exception)
831 : {
832 : static jmethodID mID(NULL);
833 0 : return impl_callBooleanMethodWithIntArg( "supportsTransactionIsolationLevel", mID, level );
834 : }
835 :
836 2 : bool java_sql_DatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
837 : {
838 : static jmethodID mID(NULL);
839 2 : return impl_callBooleanMethod( "supportsSchemasInDataManipulation", mID );
840 : }
841 :
842 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException, std::exception)
843 : {
844 : static jmethodID mID(NULL);
845 0 : return impl_callBooleanMethod( "supportsANSI92FullSQL", mID );
846 : }
847 :
848 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException, std::exception)
849 : {
850 : static jmethodID mID(NULL);
851 0 : return impl_callBooleanMethod( "supportsANSI92EntryLevelSQL", mID );
852 : }
853 :
854 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException, std::exception)
855 : {
856 : static jmethodID mID(NULL);
857 0 : return impl_callBooleanMethod( "supportsIntegrityEnhancementFacility", mID );
858 : }
859 :
860 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException, std::exception)
861 : {
862 : static jmethodID mID(NULL);
863 0 : return impl_callBooleanMethod( "supportsSchemasInIndexDefinitions", mID );
864 : }
865 :
866 0 : bool java_sql_DatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
867 : {
868 : static jmethodID mID(NULL);
869 0 : return impl_callBooleanMethod( "supportsSchemasInTableDefinitions", mID );
870 : }
871 :
872 0 : bool java_sql_DatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
873 : {
874 : static jmethodID mID(NULL);
875 0 : return impl_callBooleanMethod( "supportsCatalogsInTableDefinitions", mID );
876 : }
877 :
878 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException, std::exception)
879 : {
880 : static jmethodID mID(NULL);
881 0 : return impl_callBooleanMethod( "supportsCatalogsInIndexDefinitions", mID );
882 : }
883 :
884 2 : bool java_sql_DatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
885 : {
886 : static jmethodID mID(NULL);
887 2 : return impl_callBooleanMethod( "supportsCatalogsInDataManipulation", mID );
888 : }
889 :
890 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
891 : {
892 : static jmethodID mID(NULL);
893 0 : return impl_callBooleanMethod( "supportsOuterJoins", mID );
894 : }
895 :
896 4 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException, std::exception)
897 : {
898 : static jmethodID mID(NULL);
899 4 : return impl_callResultSetMethod( "getTableTypes", mID );
900 : }
901 :
902 0 : sal_Int32 java_sql_DatabaseMetaData::impl_getMaxStatements_throw( )
903 : {
904 : static jmethodID mID(NULL);
905 0 : return impl_callIntMethod_ThrowSQL("getMaxStatements", mID);
906 : }
907 :
908 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException, std::exception)
909 : {
910 : static jmethodID mID(NULL);
911 0 : return impl_callIntMethod_ThrowSQL("getMaxProcedureNameLength", mID);
912 : }
913 :
914 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException, std::exception)
915 : {
916 : static jmethodID mID(NULL);
917 0 : return impl_callIntMethod_ThrowSQL("getMaxSchemaNameLength", mID);
918 : }
919 :
920 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException, std::exception)
921 : {
922 : static jmethodID mID(NULL);
923 0 : return impl_callBooleanMethod( "supportsTransactions", mID );
924 : }
925 :
926 :
927 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException, std::exception)
928 : {
929 : static jmethodID mID(NULL);
930 0 : return impl_callBooleanMethod( "allProceduresAreCallable", mID );
931 : }
932 :
933 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException, std::exception)
934 : {
935 : static jmethodID mID(NULL);
936 0 : return impl_callBooleanMethod( "supportsStoredProcedures", mID );
937 : }
938 :
939 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException, std::exception)
940 : {
941 : static jmethodID mID(NULL);
942 0 : return impl_callBooleanMethod( "supportsSelectForUpdate", mID );
943 : }
944 :
945 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException, std::exception)
946 : {
947 : static jmethodID mID(NULL);
948 0 : return impl_callBooleanMethod( "allTablesAreSelectable", mID );
949 : }
950 :
951 2 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException, std::exception)
952 : {
953 : static jmethodID mID(NULL);
954 2 : return impl_callBooleanMethod( "isReadOnly", mID );
955 : }
956 :
957 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException, std::exception)
958 : {
959 : static jmethodID mID(NULL);
960 0 : return impl_callBooleanMethod( "usesLocalFiles", mID );
961 : }
962 :
963 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException, std::exception)
964 : {
965 : static jmethodID mID(NULL);
966 0 : return impl_callBooleanMethod( "usesLocalFilePerTable", mID );
967 : }
968 :
969 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException, std::exception)
970 : {
971 : static jmethodID mID(NULL);
972 0 : return impl_callBooleanMethod( "supportsTypeConversion", mID );
973 : }
974 :
975 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException, std::exception)
976 : {
977 : static jmethodID mID(NULL);
978 0 : return impl_callBooleanMethod( "nullPlusNonNullIsNull", mID );
979 : }
980 :
981 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException, std::exception)
982 : {
983 : static jmethodID mID(NULL);
984 0 : return impl_callBooleanMethod( "supportsColumnAliasing", mID );
985 : }
986 :
987 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException, std::exception)
988 : {
989 : static jmethodID mID(NULL);
990 0 : return impl_callBooleanMethod( "supportsTableCorrelationNames", mID );
991 : }
992 :
993 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException, std::exception)
994 : {
995 : static const char* pMethodName = "supportsConvert";
996 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, fromType, toType );
997 :
998 0 : jboolean out( sal_False );
999 0 : SDBThreadAttach t;
1000 :
1001 : {
1002 : static jmethodID mID(NULL);
1003 0 : obtainMethodId_throwSQL(t.pEnv, pMethodName,"(II)Z", mID);
1004 0 : out = t.pEnv->CallBooleanMethod( object, mID, fromType, toType );
1005 0 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1006 : }
1007 :
1008 0 : m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
1009 0 : return out;
1010 : }
1011 :
1012 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException, std::exception)
1013 : {
1014 : static jmethodID mID(NULL);
1015 0 : return impl_callBooleanMethod( "supportsExpressionsInOrderBy", mID );
1016 : }
1017 :
1018 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException, std::exception)
1019 : {
1020 : static jmethodID mID(NULL);
1021 0 : return impl_callBooleanMethod( "supportsGroupBy", mID );
1022 : }
1023 :
1024 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException, std::exception)
1025 : {
1026 : static jmethodID mID(NULL);
1027 0 : return impl_callBooleanMethod( "supportsGroupByBeyondSelect", mID );
1028 : }
1029 :
1030 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException, std::exception)
1031 : {
1032 : static jmethodID mID(NULL);
1033 0 : return impl_callBooleanMethod( "supportsGroupByUnrelated", mID );
1034 : }
1035 :
1036 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException, std::exception)
1037 : {
1038 : static jmethodID mID(NULL);
1039 0 : return impl_callBooleanMethod( "supportsMultipleTransactions", mID );
1040 : }
1041 :
1042 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException, std::exception)
1043 : {
1044 : static jmethodID mID(NULL);
1045 0 : return impl_callBooleanMethod( "supportsMultipleResultSets", mID );
1046 : }
1047 :
1048 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException, std::exception)
1049 : {
1050 : static jmethodID mID(NULL);
1051 0 : return impl_callBooleanMethod( "supportsLikeEscapeClause", mID );
1052 : }
1053 :
1054 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException, std::exception)
1055 : {
1056 : static jmethodID mID(NULL);
1057 0 : return impl_callBooleanMethod( "supportsOrderByUnrelated", mID );
1058 : }
1059 :
1060 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException, std::exception)
1061 : {
1062 : static jmethodID mID(NULL);
1063 0 : return impl_callBooleanMethod( "supportsUnion", mID );
1064 : }
1065 :
1066 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException, std::exception)
1067 : {
1068 : static jmethodID mID(NULL);
1069 0 : return impl_callBooleanMethod( "supportsUnionAll", mID );
1070 : }
1071 :
1072 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
1073 : {
1074 : static jmethodID mID(NULL);
1075 0 : return impl_callBooleanMethod( "supportsMixedCaseIdentifiers", mID );
1076 : }
1077 :
1078 4 : bool java_sql_DatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
1079 : {
1080 : static jmethodID mID(NULL);
1081 4 : return impl_callBooleanMethod( "supportsMixedCaseQuotedIdentifiers", mID );
1082 : }
1083 :
1084 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException, std::exception)
1085 : {
1086 : static jmethodID mID(NULL);
1087 0 : return impl_callBooleanMethod( "nullsAreSortedAtEnd", mID );
1088 : }
1089 :
1090 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException, std::exception)
1091 : {
1092 : static jmethodID mID(NULL);
1093 0 : return impl_callBooleanMethod( "nullsAreSortedAtStart", mID );
1094 : }
1095 :
1096 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException, std::exception)
1097 : {
1098 : static jmethodID mID(NULL);
1099 0 : return impl_callBooleanMethod( "nullsAreSortedHigh", mID );
1100 : }
1101 :
1102 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException, std::exception)
1103 : {
1104 : static jmethodID mID(NULL);
1105 0 : return impl_callBooleanMethod( "nullsAreSortedLow", mID );
1106 : }
1107 :
1108 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException, std::exception)
1109 : {
1110 : static jmethodID mID(NULL);
1111 0 : return impl_callBooleanMethod( "supportsSchemasInProcedureCalls", mID );
1112 : }
1113 :
1114 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException, std::exception)
1115 : {
1116 : static jmethodID mID(NULL);
1117 0 : return impl_callBooleanMethod( "supportsSchemasInPrivilegeDefinitions", mID );
1118 : }
1119 :
1120 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException, std::exception)
1121 : {
1122 : static jmethodID mID(NULL);
1123 0 : return impl_callBooleanMethod( "supportsCatalogsInProcedureCalls", mID );
1124 : }
1125 :
1126 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException, std::exception)
1127 : {
1128 : static jmethodID mID(NULL);
1129 0 : return impl_callBooleanMethod( "supportsCatalogsInPrivilegeDefinitions", mID );
1130 : }
1131 :
1132 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException, std::exception)
1133 : {
1134 : static jmethodID mID(NULL);
1135 0 : return impl_callBooleanMethod( "supportsCorrelatedSubqueries", mID );
1136 : }
1137 :
1138 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException, std::exception)
1139 : {
1140 : static jmethodID mID(NULL);
1141 0 : return impl_callBooleanMethod( "supportsSubqueriesInComparisons", mID );
1142 : }
1143 :
1144 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException, std::exception)
1145 : {
1146 : static jmethodID mID(NULL);
1147 0 : return impl_callBooleanMethod( "supportsSubqueriesInExists", mID );
1148 : }
1149 :
1150 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException, std::exception)
1151 : {
1152 : static jmethodID mID(NULL);
1153 0 : return impl_callBooleanMethod( "supportsSubqueriesInIns", mID );
1154 : }
1155 :
1156 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException, std::exception)
1157 : {
1158 : static jmethodID mID(NULL);
1159 0 : return impl_callBooleanMethod( "supportsSubqueriesInQuantifieds", mID );
1160 : }
1161 :
1162 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException, std::exception)
1163 : {
1164 : static jmethodID mID(NULL);
1165 0 : return impl_callBooleanMethod( "supportsANSI92IntermediateSQL", mID );
1166 : }
1167 :
1168 4 : OUString SAL_CALL java_sql_DatabaseMetaData::getURL( ) throw(SQLException, RuntimeException, std::exception)
1169 : {
1170 4 : OUString sURL = m_pConnection->getURL();
1171 4 : if ( sURL.isEmpty() )
1172 : {
1173 : static jmethodID mID(NULL);
1174 0 : sURL = impl_callStringMethod( "getURL", mID );
1175 : }
1176 4 : return sURL;
1177 : }
1178 :
1179 4 : OUString SAL_CALL java_sql_DatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException, std::exception)
1180 : {
1181 : static jmethodID mID(NULL);
1182 4 : return impl_callStringMethod( "getUserName", mID );
1183 : }
1184 :
1185 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException, std::exception)
1186 : {
1187 : static jmethodID mID(NULL);
1188 0 : return impl_callStringMethod( "getDriverName", mID );
1189 : }
1190 :
1191 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException, std::exception)
1192 : {
1193 : static jmethodID mID(NULL);
1194 0 : return impl_callStringMethod( "getDriverVersion", mID );
1195 : }
1196 :
1197 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException, std::exception)
1198 : {
1199 : static jmethodID mID(NULL);
1200 0 : return impl_callStringMethod( "getDatabaseProductVersion", mID );
1201 : }
1202 :
1203 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException, std::exception)
1204 : {
1205 : static jmethodID mID(NULL);
1206 0 : return impl_callStringMethod( "getDatabaseProductName", mID );
1207 : }
1208 :
1209 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException, std::exception)
1210 : {
1211 : static jmethodID mID(NULL);
1212 0 : return impl_callStringMethod( "getProcedureTerm", mID );
1213 : }
1214 :
1215 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException, std::exception)
1216 : {
1217 : static jmethodID mID(NULL);
1218 0 : return impl_callStringMethod( "getSchemaTerm", mID );
1219 : }
1220 :
1221 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException, std::exception)
1222 : {
1223 : static jmethodID mID(NULL);
1224 0 : return impl_callIntMethod_ThrowRuntime("getDriverMajorVersion", mID);
1225 : }
1226 :
1227 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException, std::exception)
1228 : {
1229 : static jmethodID mID(NULL);
1230 0 : return impl_callIntMethod_ThrowSQL("getDefaultTransactionIsolation", mID);
1231 : }
1232 :
1233 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException, std::exception)
1234 : {
1235 : static jmethodID mID(NULL);
1236 0 : return impl_callIntMethod_ThrowRuntime("getDriverMinorVersion", mID);
1237 : }
1238 :
1239 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException, std::exception)
1240 : {
1241 : static jmethodID mID(NULL);
1242 0 : return impl_callStringMethod( "getSQLKeywords", mID );
1243 : }
1244 :
1245 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException, std::exception)
1246 : {
1247 : static jmethodID mID(NULL);
1248 0 : return impl_callStringMethod( "getSearchStringEscape", mID );
1249 : }
1250 :
1251 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException, std::exception)
1252 : {
1253 : static jmethodID mID(NULL);
1254 0 : return impl_callStringMethod( "getStringFunctions", mID );
1255 : }
1256 :
1257 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException, std::exception)
1258 : {
1259 : static jmethodID mID(NULL);
1260 0 : return impl_callStringMethod( "getTimeDateFunctions", mID );
1261 : }
1262 :
1263 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException, std::exception)
1264 : {
1265 : static jmethodID mID(NULL);
1266 0 : return impl_callStringMethod( "getSystemFunctions", mID );
1267 : }
1268 :
1269 0 : OUString SAL_CALL java_sql_DatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException, std::exception)
1270 : {
1271 : static jmethodID mID(NULL);
1272 0 : return impl_callStringMethod( "getNumericFunctions", mID );
1273 : }
1274 :
1275 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
1276 : {
1277 : static jmethodID mID(NULL);
1278 0 : return impl_callBooleanMethod( "supportsExtendedSQLGrammar", mID );
1279 : }
1280 :
1281 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
1282 : {
1283 : static jmethodID mID(NULL);
1284 0 : return impl_callBooleanMethod( "supportsCoreSQLGrammar", mID );
1285 : }
1286 :
1287 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
1288 : {
1289 : static jmethodID mID(NULL);
1290 0 : return impl_callBooleanMethod( "supportsMinimumSQLGrammar", mID );
1291 : }
1292 :
1293 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
1294 : {
1295 : static jmethodID mID(NULL);
1296 0 : return impl_callBooleanMethod( "supportsFullOuterJoins", mID );
1297 : }
1298 :
1299 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
1300 : {
1301 : static jmethodID mID(NULL);
1302 0 : return impl_callBooleanMethod( "supportsLimitedOuterJoins", mID );
1303 : }
1304 :
1305 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException, std::exception)
1306 : {
1307 : static jmethodID mID(NULL);
1308 0 : return impl_callIntMethod_ThrowSQL("getMaxColumnsInGroupBy", mID);
1309 : }
1310 :
1311 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException, std::exception)
1312 : {
1313 : static jmethodID mID(NULL);
1314 0 : return impl_callIntMethod_ThrowSQL("getMaxColumnsInOrderBy", mID);
1315 : }
1316 :
1317 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException, std::exception)
1318 : {
1319 : static jmethodID mID(NULL);
1320 0 : return impl_callIntMethod_ThrowSQL("getMaxColumnsInSelect", mID);
1321 : }
1322 :
1323 0 : sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException, std::exception)
1324 : {
1325 : static jmethodID mID(NULL);
1326 0 : return impl_callIntMethod_ThrowSQL("getMaxUserNameLength", mID);
1327 : }
1328 :
1329 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1330 : {
1331 : static jmethodID mID(NULL);
1332 0 : return impl_callBooleanMethodWithIntArg( "supportsResultSetType", mID, setType );
1333 : }
1334 :
1335 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException, std::exception)
1336 : {
1337 : static const char* pMethodName = "supportsResultSetConcurrency";
1338 0 : m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, setType, concurrency );
1339 :
1340 0 : jboolean out( sal_False );
1341 0 : SDBThreadAttach t;
1342 :
1343 : {
1344 : static jmethodID mID(NULL);
1345 0 : obtainMethodId_throwSQL(t.pEnv, pMethodName,"(II)Z", mID);
1346 0 : out = t.pEnv->CallBooleanMethod( object, mID, setType, concurrency);
1347 0 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1348 : }
1349 :
1350 0 : m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
1351 0 : return out;
1352 : }
1353 :
1354 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1355 : {
1356 : static jmethodID mID(NULL);
1357 0 : return impl_callBooleanMethodWithIntArg( "ownUpdatesAreVisible", mID, setType );
1358 : }
1359 :
1360 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1361 : {
1362 : static jmethodID mID(NULL);
1363 0 : return impl_callBooleanMethodWithIntArg( "ownDeletesAreVisible", mID, setType );
1364 : }
1365 :
1366 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1367 : {
1368 : static jmethodID mID(NULL);
1369 0 : return impl_callBooleanMethodWithIntArg( "ownInsertsAreVisible", mID, setType );
1370 : }
1371 :
1372 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1373 : {
1374 : static jmethodID mID(NULL);
1375 0 : return impl_callBooleanMethodWithIntArg( "othersUpdatesAreVisible", mID, setType );
1376 : }
1377 :
1378 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1379 : {
1380 : static jmethodID mID(NULL);
1381 0 : return impl_callBooleanMethodWithIntArg( "othersDeletesAreVisible", mID, setType );
1382 : }
1383 :
1384 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1385 : {
1386 : static jmethodID mID(NULL);
1387 0 : return impl_callBooleanMethodWithIntArg( "othersInsertsAreVisible", mID, setType );
1388 : }
1389 :
1390 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1391 : {
1392 : static jmethodID mID(NULL);
1393 0 : return impl_callBooleanMethodWithIntArg( "updatesAreDetected", mID, setType );
1394 : }
1395 :
1396 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1397 : {
1398 : static jmethodID mID(NULL);
1399 0 : return impl_callBooleanMethodWithIntArg( "deletesAreDetected", mID, setType );
1400 : }
1401 :
1402 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
1403 : {
1404 : static jmethodID mID(NULL);
1405 0 : return impl_callBooleanMethodWithIntArg( "insertsAreDetected", mID, setType );
1406 : }
1407 :
1408 0 : sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException, std::exception)
1409 : {
1410 : static jmethodID mID(NULL);
1411 0 : return impl_callBooleanMethod( "supportsBatchUpdates", mID );
1412 : }
1413 :
1414 0 : Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getUDTs(
1415 : const Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern,
1416 : const Sequence< sal_Int32 >& types ) throw(SQLException, RuntimeException, std::exception)
1417 : {
1418 0 : jobject out(0);
1419 0 : SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
1420 : {
1421 :
1422 :
1423 : static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I)Ljava/sql/ResultSet;";
1424 : static const char * cMethodName = "getUDTs";
1425 : // dismiss Java-Call
1426 : static jmethodID mID(NULL);
1427 0 : obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
1428 : {
1429 : jvalue args[4];
1430 : // initialize temporary Variable
1431 0 : args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
1432 0 : args[1].l = schemaPattern.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schemaPattern);
1433 0 : args[2].l = convertwchar_tToJavaString(t.pEnv,typeNamePattern);
1434 0 : jintArray pArray = t.pEnv->NewIntArray(types.getLength());
1435 0 : t.pEnv->SetIntArrayRegion(pArray,0,types.getLength(),(jint*)types.getConstArray());
1436 0 : args[3].l = pArray;
1437 :
1438 0 : out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
1439 :
1440 0 : if(catalog.hasValue())
1441 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l));
1442 0 : if(!schemaPattern.isEmpty())
1443 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l));
1444 0 : if(!typeNamePattern.isEmpty())
1445 0 : t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l));
1446 0 : if(args[3].l)
1447 0 : t.pEnv->DeleteLocalRef(static_cast<jintArray>(args[3].l));
1448 0 : ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1449 : }
1450 : }
1451 :
1452 0 : return out ? new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection ) : 0;
1453 : }
1454 :
1455 :
1456 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|