LibreOffice Module connectivity (master) 1
OConnection.cxx
Go to the documentation of this file.
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 <odbc/OTools.hxx>
21#include <odbc/OConnection.hxx>
23#include <odbc/OFunctions.hxx>
24#include <odbc/ODriver.hxx>
25#include <odbc/OStatement.hxx>
29
30#include <sal/log.hxx>
31
32#include <string.h>
33
34using namespace connectivity::odbc;
35using namespace connectivity;
36using namespace dbtools;
37
38
39using namespace com::sun::star::uno;
40using namespace com::sun::star::lang;
41using namespace com::sun::star::beans;
42using namespace com::sun::star::sdbc;
43
44OConnection::OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver)
45 :m_xDriver(_pDriver)
46 ,m_aConnectionHandle(nullptr)
47 ,m_pDriverHandleCopy(_pDriverHandle)
48 ,m_nStatementCount(0)
49 ,m_bClosed(false)
50 ,m_bUseCatalog(false)
51 ,m_bUseOldDateFormat(false)
52 ,m_bIgnoreDriverPrivileges(false)
53 ,m_bPreventGetVersionColumns(false)
54 ,m_bReadOnly(true)
55{
56}
57
59{
60 if(!isClosed( ))
61 close();
62
63 if ( SQL_NULL_HANDLE == m_aConnectionHandle )
64 return;
65
66 SQLRETURN rc;
67
68 if (!m_bClosed)
69 {
71 OSL_ENSURE( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO, "Failure from SQLDisconnect" );
72 }
73
74 rc = N3SQLFreeHandle( SQL_HANDLE_DBC, m_aConnectionHandle );
75 OSL_ENSURE( rc == SQL_SUCCESS , "Failure from SQLFreeHandle for connection");
76
77 m_aConnectionHandle = SQL_NULL_HANDLE;
78}
79
80oslGenericFunction OConnection::getOdbcFunction(ODBC3SQLFunctionId _nIndex) const
81{
82 OSL_ENSURE(m_xDriver, "OConnection::getOdbcFunction: m_xDriver is null!");
83 return m_xDriver->getOdbcFunction(_nIndex);
84}
85
86SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTimeOut, bool bSilent)
87{
88 ::osl::MutexGuard aGuard( m_aMutex );
89
90 if (m_aConnectionHandle == SQL_NULL_HANDLE)
91 return -1;
92
93 SQLRETURN nSQLRETURN = 0;
94 SDB_ODBC_CHAR szConnStrOut[4096] = {};
95 SDB_ODBC_CHAR szConnStrIn[2048] = {};
96 SQLSMALLINT cbConnStrOut;
97 OString aConStr(OUStringToOString(aConnectStr,getTextEncoding()));
98 memcpy(szConnStrIn, aConStr.getStr(), std::min<sal_Int32>(sal_Int32(2048),aConStr.getLength()));
99
100#ifndef MACOSX
101 N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_LOGIN_TIMEOUT,reinterpret_cast<SQLPOINTER>(nTimeOut),SQL_IS_UINTEGER);
102#else
103 (void)nTimeOut; /* WaE */
104#endif
105
106#ifdef LINUX
107 (void) bSilent;
109 nullptr,
110 szConnStrIn,
111 static_cast<SQLSMALLINT>(std::min(sal_Int32(2048),aConStr.getLength())),
112 szConnStrOut,
113 SQLSMALLINT(sizeof(szConnStrOut)/sizeof(SDB_ODBC_CHAR)) -1,
114 &cbConnStrOut,
115 SQL_DRIVER_NOPROMPT);
116 if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA || SQL_SUCCESS_WITH_INFO == nSQLRETURN)
117 return nSQLRETURN;
118#else
119
120 SQLUSMALLINT nSilent = bSilent ? SQL_DRIVER_NOPROMPT : SQL_DRIVER_COMPLETE;
122 nullptr,
123 szConnStrIn,
124 static_cast<SQLSMALLINT>(std::min<sal_Int32>(sal_Int32(2048),aConStr.getLength())),
125 szConnStrOut,
126 SQLSMALLINT(sizeof szConnStrOut),
127 &cbConnStrOut,
128 nSilent);
129 if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
130 return nSQLRETURN;
131
132 m_bClosed = false;
133
134#endif //LINUX
135
136 try
137 {
138 OUString aVal;
139 OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding());
140 m_bReadOnly = aVal == "Y";
141 }
142 catch(Exception&)
143 {
144 m_bReadOnly = true;
145 }
146 try
147 {
148 OUString sVersion;
149 OTools::GetInfo(this,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,sVersion,*this,getTextEncoding());
150 m_bUseOldDateFormat = sVersion == "02.50" || sVersion == "02.00";
151 }
152 catch(Exception&)
153 {
154 }
155
156
157 // autocommit is always default
158
159 if (!m_bReadOnly)
160 N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_AUTOCOMMIT, reinterpret_cast<SQLPOINTER>(SQL_AUTOCOMMIT_ON),SQL_IS_INTEGER);
161
162 return nSQLRETURN;
163}
164
165SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyValue >& info)
166{
167 m_aConnectionHandle = SQL_NULL_HANDLE;
168 m_sURL = url;
169 setConnectionInfo(info);
170
172 if(m_aConnectionHandle == SQL_NULL_HANDLE)
173 throw SQLException();
174
175 sal_Int32 nLen = url.indexOf(':');
176 nLen = url.indexOf(':',nLen+2);
177 OUString aDSN("DSN="), aUID, aPWD, aSysDrvSettings;
178 aDSN += url.subView(nLen+1);
179
180 sal_Int32 nTimeout = 20;
181 bool bSilent = true;
182 const PropertyValue *pBegin = info.getConstArray();
183 const PropertyValue *pEnd = pBegin + info.getLength();
184 for(;pBegin != pEnd;++pBegin)
185 {
186 if( pBegin->Name == "Timeout")
187 {
188 if( ! (pBegin->Value >>= nTimeout) )
189 SAL_WARN("connectivity.odbc", "Construct: unable to get property Timeout");
190 }
191 else if( pBegin->Name == "Silent")
192 {
193 if( ! (pBegin->Value >>= bSilent) )
194 SAL_WARN("connectivity.odbc", "Construct: unable to get property Silent");
195 }
196 else if( pBegin->Name == "IgnoreDriverPrivileges")
197 {
198 if( ! (pBegin->Value >>= m_bIgnoreDriverPrivileges) )
199 SAL_WARN("connectivity.odbc", "Construct: unable to get property IgnoreDriverPrivileges");
200 }
201 else if( pBegin->Name == "PreventGetVersionColumns")
202 {
203 if( ! (pBegin->Value >>= m_bPreventGetVersionColumns) )
204 SAL_WARN("connectivity.odbc", "Construct: unable to get property PreventGetVersionColumns");
205 }
206 else if( pBegin->Name == "IsAutoRetrievingEnabled")
207 {
208 bool bAutoRetrievingEnabled = false;
209 if( ! (pBegin->Value >>= bAutoRetrievingEnabled) )
210 SAL_WARN("connectivity.odbc", "Construct: unable to get property IsAutoRetrievingEnabled");
211 enableAutoRetrievingEnabled(bAutoRetrievingEnabled);
212 }
213 else if( pBegin->Name == "AutoRetrievingStatement")
214 {
215 OUString sGeneratedValueStatement;
216 if( ! (pBegin->Value >>= sGeneratedValueStatement) )
217 SAL_WARN("connectivity.odbc", "Construct: unable to get property AutoRetrievingStatement");
218 setAutoRetrievingStatement(sGeneratedValueStatement);
219 }
220 else if( pBegin->Name == "user")
221 {
222 if( ! (pBegin->Value >>= aUID) )
223 SAL_WARN("connectivity.odbc", "Construct: unable to get property user");
224 aDSN += ";UID=" + aUID;
225 }
226 else if( pBegin->Name == "password")
227 {
228 if( ! (pBegin->Value >>= aPWD) )
229 SAL_WARN("connectivity.odbc", "Construct: unable to get property password");
230 aDSN += ";PWD=" + aPWD;
231 }
232 else if( pBegin->Name == "UseCatalog")
233 {
234 if( !( pBegin->Value >>= m_bUseCatalog) )
235 SAL_WARN("connectivity.odbc", "Construct: unable to get property UseCatalog");
236 }
237 else if( pBegin->Name == "SystemDriverSettings")
238 {
239 if( ! (pBegin->Value >>= aSysDrvSettings) )
240 SAL_WARN("connectivity.odbc", "Construct: unable to get property SystemDriverSettings");
241 aDSN += ";" + aSysDrvSettings;
242 }
243 else if( pBegin->Name == "CharSet")
244 {
245 OUString sIanaName;
246 if( ! (pBegin->Value >>= sIanaName) )
247 SAL_WARN("connectivity.odbc", "Construct: unable to get property CharSet");
248
249 ::dbtools::OCharsetMap aLookupIanaName;
250 ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.findIanaName(sIanaName);
251 if (aLookup != aLookupIanaName.end())
252 m_nTextEncoding = (*aLookup).getEncoding();
253 else
254 m_nTextEncoding = RTL_TEXTENCODING_DONTKNOW;
255 if(m_nTextEncoding == RTL_TEXTENCODING_DONTKNOW)
256 m_nTextEncoding = osl_getThreadTextEncoding();
257 }
258 }
259 m_sUser = aUID;
260
261 SQLRETURN nSQLRETURN = OpenConnection(aDSN,nTimeout, bSilent);
262 if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
263 {
264 OTools::ThrowException(this,nSQLRETURN,m_aConnectionHandle,SQL_HANDLE_DBC,*this,false);
265 }
266 return nSQLRETURN;
267}
268// XServiceInfo
269
270IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.odbc.OConnection", "com.sun.star.sdbc.Connection")
271
272
273Reference< XStatement > SAL_CALL OConnection::createStatement( )
274{
275 ::osl::MutexGuard aGuard( m_aMutex );
276 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
277
278 Reference< XStatement > xReturn = new OStatement(this);
279 m_aStatements.push_back(WeakReferenceHelper(xReturn));
280 return xReturn;
281}
282
284{
285 ::osl::MutexGuard aGuard( m_aMutex );
286 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
287
289 m_aStatements.push_back(WeakReferenceHelper(xReturn));
290 return xReturn;
291}
292
294{
295 ::dbtools::throwFeatureNotImplementedSQLException( "XConnection::prepareCall", *this );
296 return nullptr;
297}
298
299OUString SAL_CALL OConnection::nativeSQL( const OUString& sql )
300{
301 ::osl::MutexGuard aGuard( m_aMutex );
302
303 OString aSql(OUStringToOString(sql,getTextEncoding()));
304 char pOut[2048];
305 SQLINTEGER nOutLen;
306 OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aSql.getStr())),aSql.getLength(),reinterpret_cast<SDB_ODBC_CHAR*>(pOut),sizeof pOut - 1,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
307 return OUString(pOut,nOutLen,getTextEncoding());
308}
309
310void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit )
311{
312 ::osl::MutexGuard aGuard( m_aMutex );
313 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
314
315
317 SQL_ATTR_AUTOCOMMIT,
318 reinterpret_cast<SQLPOINTER>((autoCommit) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF) ,SQL_IS_INTEGER),
319 m_aConnectionHandle,SQL_HANDLE_DBC,*this);
320}
321
323{
324 ::osl::MutexGuard aGuard( m_aMutex );
325 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
326
327
328 sal_uInt32 nOption = 0;
330 SQL_ATTR_AUTOCOMMIT, &nOption,0,nullptr),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
331 return nOption == SQL_AUTOCOMMIT_ON ;
332}
333
334void SAL_CALL OConnection::commit( )
335{
336 ::osl::MutexGuard aGuard( m_aMutex );
337 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
338
339
340 OTools::ThrowException(this,N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_COMMIT),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
341}
342
343void SAL_CALL OConnection::rollback( )
344{
345 ::osl::MutexGuard aGuard( m_aMutex );
346 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
347
348
349 OTools::ThrowException(this,N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_ROLLBACK),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
350}
351
353{
354 ::osl::MutexGuard aGuard( m_aMutex );
355
356 return OConnection_BASE::rBHelper.bDisposed;
357}
358
360{
361 ::osl::MutexGuard aGuard( m_aMutex );
362 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
363
365 if(!xMetaData.is())
366 {
367 xMetaData = new ODatabaseMetaData(m_aConnectionHandle,this);
368 m_xMetaData = xMetaData;
369 }
370
371 return xMetaData;
372}
373
374void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly )
375{
376 ::osl::MutexGuard aGuard( m_aMutex );
377 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
378
379
381 N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_ACCESS_MODE,reinterpret_cast< SQLPOINTER >( readOnly ),SQL_IS_INTEGER),
382 m_aConnectionHandle,SQL_HANDLE_DBC,*this);
383}
384
386{
387 // const member which will initialized only once
388 return m_bReadOnly;
389}
390
391void SAL_CALL OConnection::setCatalog( const OUString& catalog )
392{
393 ::osl::MutexGuard aGuard( m_aMutex );
394 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
395
396
397 OString aCat(OUStringToOString(catalog,getTextEncoding()));
399 N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,const_cast<char *>(aCat.getStr()),SQL_NTS),
400 m_aConnectionHandle,SQL_HANDLE_DBC,*this);
401}
402
403OUString SAL_CALL OConnection::getCatalog( )
404{
405 ::osl::MutexGuard aGuard( m_aMutex );
406 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
407
408
409 SQLINTEGER nValueLen;
410 char pCat[1024];
412 N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,pCat,(sizeof pCat)-1,&nValueLen),
413 m_aConnectionHandle,SQL_HANDLE_DBC,*this);
414
415 return OUString(pCat,nValueLen,getTextEncoding());
416}
417
418void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level )
419{
420 ::osl::MutexGuard aGuard( m_aMutex );
421 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
422
423
425 SQL_ATTR_TXN_ISOLATION,
426 reinterpret_cast<SQLPOINTER>(level),SQL_IS_INTEGER),
427 m_aConnectionHandle,SQL_HANDLE_DBC,*this);
428}
429
431{
432 ::osl::MutexGuard aGuard( m_aMutex );
433 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
434
435
436 sal_Int32 nTxn = 0;
437 SQLINTEGER nValueLen;
439 N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_TXN_ISOLATION,&nTxn,sizeof nTxn,&nValueLen),
440 m_aConnectionHandle,SQL_HANDLE_DBC,*this);
441 return nTxn;
442}
443
445{
446 ::osl::MutexGuard aGuard( m_aMutex );
447 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
448
449
450 return nullptr;
451}
452
454{
455 ::dbtools::throwFeatureNotImplementedSQLException( "XConnection::setTypeMap", *this );
456}
457
458// XCloseable
459void SAL_CALL OConnection::close( )
460{
461 {
462 ::osl::MutexGuard aGuard( m_aMutex );
463 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
464
465 }
466 dispose();
467}
468
469// XWarningsSupplier
471{
472 return Any();
473}
474
476{
477}
478
480{
481 ::osl::MutexGuard aGuard(m_aMutex);
482
484
485 for (auto const& connection : m_aConnections)
486 connection.second->dispose();
487
488 m_aConnections.clear();
489
490 if(!m_bClosed)
492 m_bClosed = true;
493}
494
496{
497 rtl::Reference<OConnection> xConnectionTemp = this;
498 bool bNew = false;
499 try
500 {
501 sal_Int32 nMaxStatements = getMetaData()->getMaxStatements();
502 if(nMaxStatements && nMaxStatements <= m_nStatementCount)
503 {
505 xConnection->Construct(m_sURL,getConnectionInfo());
506 xConnectionTemp = xConnection;
507 bNew = true;
508 }
509 }
510 catch(SQLException&)
511 {
512 }
513
514 SQLHANDLE aStatementHandle = SQL_NULL_HANDLE;
515 N3SQLAllocHandle(SQL_HANDLE_STMT,xConnectionTemp->getConnection(),&aStatementHandle);
517 if(bNew)
518 m_aConnections.emplace(aStatementHandle,xConnectionTemp);
519
520 return aStatementHandle;
521
522}
523
524void OConnection::freeStatementHandle(SQLHANDLE& _pHandle)
525{
526 if( SQL_NULL_HANDLE == _pHandle )
527 return;
528
529 auto aFind = m_aConnections.find(_pHandle);
530
531 N3SQLFreeStmt(_pHandle,SQL_RESET_PARAMS);
532 N3SQLFreeStmt(_pHandle,SQL_UNBIND);
533 N3SQLFreeStmt(_pHandle,SQL_CLOSE);
534 N3SQLFreeHandle(SQL_HANDLE_STMT,_pHandle);
535
536 _pHandle = SQL_NULL_HANDLE;
537
538 if(aFind != m_aConnections.end())
539 {
540 aFind->second->dispose();
541 m_aConnections.erase(aFind);
542 }
544}
545
546
547/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname)
#define N3SQLFreeHandle(a, b)
Definition: OFunctions.hxx:517
#define N3SQLAllocHandle(a, b, c)
Definition: OFunctions.hxx:36
#define N3SQLDriverConnect(a, b, c, d, e, f, g, h)
Definition: OFunctions.hxx:51
#define N3SQLDisconnect(a)
Definition: OFunctions.hxx:512
#define N3SQLFreeStmt(a, b)
Definition: OFunctions.hxx:493
#define N3SQLNativeSql(a, b, c, d, e, f)
Definition: OFunctions.hxx:533
#define N3SQLSetConnectAttr(a, b, c, d)
Definition: OFunctions.hxx:110
#define N3SQLEndTran(a, b, c)
Definition: OFunctions.hxx:507
#define N3SQLGetConnectAttr(a, b, c, d, e)
Definition: OFunctions.hxx:118
ODBC3SQLFunctionId
Definition: OTools.hxx:33
void setAutoRetrievingStatement(const OUString &_sStmt)
void enableAutoRetrievingEnabled(bool _bAutoEnable)
connectivity::OWeakRefArray m_aStatements
Definition: TConnection.hxx:47
void setConnectionInfo(const css::uno::Sequence< css::beans::PropertyValue > &_aInfo)
Definition: TConnection.hxx:67
css::uno::WeakReference< css::sdbc::XDatabaseMetaData > m_xMetaData
Definition: TConnection.hxx:53
const css::uno::Sequence< css::beans::PropertyValue > & getConnectionInfo() const
Definition: TConnection.hxx:69
rtl_TextEncoding getTextEncoding() const
Definition: TConnection.hxx:61
rtl_TextEncoding m_nTextEncoding
Definition: TConnection.hxx:51
virtual void SAL_CALL disposing() override
Definition: TConnection.cxx:39
virtual sal_Int32 SAL_CALL getTransactionIsolation() override
virtual void SAL_CALL setTypeMap(const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual void SAL_CALL setCatalog(const OUString &catalog) override
virtual void SAL_CALL setAutoCommit(sal_Bool autoCommit) override
virtual void SAL_CALL setTransactionIsolation(sal_Int32 level) override
virtual void SAL_CALL disposing() override
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
OConnection(const SQLHANDLE _pDriverHandle, ODBCDriver *_pDriver)
Definition: OConnection.cxx:44
virtual void SAL_CALL rollback() override
virtual OUString SAL_CALL nativeSQL(const OUString &sql) override
virtual void SAL_CALL close() override
virtual sal_Bool SAL_CALL isClosed() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap() override
oslGenericFunction getOdbcFunction(ODBC3SQLFunctionId _nIndex) const
Definition: OConnection.cxx:80
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall(const OUString &sql) override
SQLRETURN Construct(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info)
virtual ~OConnection() override
Definition: OConnection.cxx:58
virtual void SAL_CALL clearWarnings() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement(const OUString &sql) override
virtual sal_Bool SAL_CALL getAutoCommit() override
std::map< SQLHANDLE, rtl::Reference< OConnection > > m_aConnections
Definition: OConnection.hxx:50
virtual void SAL_CALL setReadOnly(sal_Bool readOnly) override
virtual sal_Bool SAL_CALL isReadOnly() override
SQLRETURN OpenConnection(const OUString &aConnectStr, sal_Int32 nTimeOut, bool bSilent)
Definition: OConnection.cxx:86
virtual OUString SAL_CALL getCatalog() override
virtual css::uno::Any SAL_CALL getWarnings() override
rtl::Reference< ODBCDriver > m_xDriver
Definition: OConnection.hxx:55
void freeStatementHandle(SQLHANDLE &_pHandle)
virtual void SAL_CALL commit() override
static void GetInfo(OConnection const *_pConnection, SQLHANDLE _aConnectionHandle, SQLUSMALLINT _nInfo, OUString &_rValue, const css::uno::Reference< css::uno::XInterface > &_xInterface, rtl_TextEncoding _nTextEncoding)
static void ThrowException(const OConnection *_pConnection, SQLRETURN _rRetCode, SQLHANDLE _pContext, SQLSMALLINT _nHandleType, const css::uno::Reference< css::uno::XInterface > &_xInterface, bool _bNoFound=true)
Definition: OTools.cxx:302
is a class which translates between different charset representations.
Definition: dbcharset.hxx:54
CharsetIterator const_iterator
Definition: dbcharset.hxx:64
CharsetIterator findIanaName(std::u16string_view _rIanaName) const
find the given IANA name in the map.
Definition: dbcharset.cxx:96
CharsetIterator end() const
get access to the (last + 1st) element of the charset collection
Definition: dbcharset.cxx:118
std::mutex m_aMutex
bool m_bReadOnly
#define SAL_WARN(area, stream)
@ Exception
void checkDisposed(bool _bThrow)
Definition: dbtools.cxx:1951
void throwFeatureNotImplementedSQLException(const OUString &_rFeatureName, const Reference< XInterface > &_rxContext, const Any &_rNextException)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Definition: pq_tools.cxx:100
void dispose()
#define SDB_ODBC_CHAR
Definition: odbc.hxx:68
unsigned char sal_Bool
oslFileHandle & pOut