summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-05-15 07:18:32 +0000
committerOcke Janssen <oj@openoffice.org>2001-05-15 07:18:32 +0000
commit2dad4a9961f38700b6432ed58b15a6b4b4a0044c (patch)
tree1771e4bccabe5c0313e278fd5eb9d84e95c113a0 /connectivity
parent47e24caf0441e627df80762aeb2765b68fd709f4 (diff)
86528# fix the function pointers for odbc
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/adabas/BDriver.cxx309
-rw-r--r--connectivity/source/drivers/adabas/BResultSet.cxx46
-rw-r--r--connectivity/source/drivers/adabas/BTables.cxx12
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk5
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx40
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaData.cxx369
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx93
-rw-r--r--connectivity/source/drivers/odbc/ODriver.cxx31
-rw-r--r--connectivity/source/drivers/odbc/OFunctions.cxx292
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx88
-rw-r--r--connectivity/source/drivers/odbc/ORealDriver.cxx404
-rw-r--r--connectivity/source/drivers/odbc/OResultSet.cxx142
-rw-r--r--connectivity/source/drivers/odbc/OResultSetMetaData.cxx18
-rw-r--r--connectivity/source/drivers/odbc/OStatement.cxx16
-rw-r--r--connectivity/source/drivers/odbc/OTools.cxx132
-rw-r--r--connectivity/source/drivers/odbc/makefile.mk9
-rw-r--r--connectivity/source/inc/adabas/BDriver.hxx5
-rw-r--r--connectivity/source/inc/odbc/OConnection.hxx6
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaData.hxx10
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx14
-rw-r--r--connectivity/source/inc/odbc/ODriver.hxx10
-rw-r--r--connectivity/source/inc/odbc/OFunctions.hxx254
-rw-r--r--connectivity/source/inc/odbc/OResultSet.hxx11
-rw-r--r--connectivity/source/inc/odbc/OResultSetMetaData.hxx23
-rw-r--r--connectivity/source/inc/odbc/OStatement.hxx9
-rw-r--r--connectivity/source/inc/odbc/OTools.hxx201
26 files changed, 1701 insertions, 848 deletions
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
index 5b124e66c84e..d8bb62b47952 100644
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ b/connectivity/source/drivers/adabas/BDriver.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BDriver.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-04-30 10:13:37 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,13 +75,84 @@
#include "odbc/OTools.hxx"
#endif
-using namespace connectivity::adabas;
+using namespace connectivity;
+namespace connectivity
+{
+ namespace adabas
+ {
+ // extern declaration of the function pointer
+ extern T3SQLAllocHandle pODBC3SQLAllocHandle;
+ extern T3SQLConnect pODBC3SQLConnect;
+ extern T3SQLDriverConnect pODBC3SQLDriverConnect;
+ extern T3SQLBrowseConnect pODBC3SQLBrowseConnect;
+ extern T3SQLDataSources pODBC3SQLDataSources;
+ extern T3SQLDrivers pODBC3SQLDrivers;
+ extern T3SQLGetInfo pODBC3SQLGetInfo;
+ extern T3SQLGetFunctions pODBC3SQLGetFunctions;
+ extern T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
+ extern T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
+ extern T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
+ extern T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
+ extern T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
+ extern T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
+ extern T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
+ //extern T3SQLSetDescField pODBC3SQLSetDescField;
+ //extern T3SQLGetDescField pODBC3SQLGetDescField;
+ //extern T3SQLGetDescRec pODBC3SQLGetDescRec;
+ //extern T3SQLSetDescRec pODBC3SQLSetDescRec;
+ extern T3SQLPrepare pODBC3SQLPrepare;
+ extern T3SQLBindParameter pODBC3SQLBindParameter;
+ //extern T3SQLGetCursorName pODBC3SQLGetCursorName;
+ extern T3SQLSetCursorName pODBC3SQLSetCursorName;
+ extern T3SQLExecute pODBC3SQLExecute;
+ extern T3SQLExecDirect pODBC3SQLExecDirect;
+ //extern T3SQLNativeSql pODBC3SQLNativeSql;
+ extern T3SQLDescribeParam pODBC3SQLDescribeParam;
+ extern T3SQLNumParams pODBC3SQLNumParams;
+ extern T3SQLParamData pODBC3SQLParamData;
+ extern T3SQLPutData pODBC3SQLPutData;
+ extern T3SQLRowCount pODBC3SQLRowCount;
+ extern T3SQLNumResultCols pODBC3SQLNumResultCols;
+ extern T3SQLDescribeCol pODBC3SQLDescribeCol;
+ extern T3SQLColAttribute pODBC3SQLColAttribute;
+ extern T3SQLBindCol pODBC3SQLBindCol;
+ extern T3SQLFetch pODBC3SQLFetch;
+ extern T3SQLFetchScroll pODBC3SQLFetchScroll;
+ extern T3SQLGetData pODBC3SQLGetData;
+ extern T3SQLSetPos pODBC3SQLSetPos;
+ extern T3SQLBulkOperations pODBC3SQLBulkOperations;
+ extern T3SQLMoreResults pODBC3SQLMoreResults;
+ //extern T3SQLGetDiagField pODBC3SQLGetDiagField;
+ extern T3SQLGetDiagRec pODBC3SQLGetDiagRec;
+ extern T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
+ extern T3SQLColumns pODBC3SQLColumns;
+ extern T3SQLForeignKeys pODBC3SQLForeignKeys;
+ extern T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
+ extern T3SQLProcedureColumns pODBC3SQLProcedureColumns;
+ extern T3SQLProcedures pODBC3SQLProcedures;
+ extern T3SQLSpecialColumns pODBC3SQLSpecialColumns;
+ extern T3SQLStatistics pODBC3SQLStatistics;
+ extern T3SQLTablePrivileges pODBC3SQLTablePrivileges;
+ extern T3SQLTables pODBC3SQLTables;
+ extern T3SQLFreeStmt pODBC3SQLFreeStmt;
+ extern T3SQLCloseCursor pODBC3SQLCloseCursor;
+ extern T3SQLCancel pODBC3SQLCancel;
+ extern T3SQLEndTran pODBC3SQLEndTran;
+ extern T3SQLDisconnect pODBC3SQLDisconnect;
+ extern T3SQLFreeHandle pODBC3SQLFreeHandle;
+ extern T3SQLGetCursorName pODBC3SQLGetCursorName;
+ extern T3SQLNativeSql pODBC3SQLNativeSql;
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
+
+ sal_Bool LoadFunctions(oslModule pODBCso);
+ sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath);
+
// --------------------------------------------------------------------------------
ODriver::ODriver()
{
@@ -138,7 +209,7 @@ Any SAL_CALL ODriver::queryInterface( const Type & rType ) throw(RuntimeExceptio
return ODriver_BASE::queryInterface(rType);
}
//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::adabas::ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) throw( ::com::sun::star::uno::Exception )
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) throw( ::com::sun::star::uno::Exception )
{
return *(new ODriver());
}
@@ -156,7 +227,7 @@ Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url,
if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
{
- connectivity::odbc::OTools::ThrowException(nSQLRETURN,pCon->getConnection(),SQL_HANDLE_DBC,*this);
+ odbc::OTools::ThrowException(pCon,nSQLRETURN,pCon->getConnection(),SQL_HANDLE_DBC,*this);
}
else if(SQL_SUCCESS_WITH_INFO == nSQLRETURN) // this driver does not support odbc3
{
@@ -204,7 +275,7 @@ SQLHANDLE ODriver::EnvironmentHandle(::rtl::OUString &_rPath)
// Environment allozieren
// ODBC-DLL jetzt laden:
- if (! connectivity::LoadLibrary_ADABAS(_rPath))
+ if (! LoadLibrary_ADABAS(_rPath))
return SQL_NULL_HANDLE;
if (N3SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&h) != SQL_SUCCESS)
@@ -265,5 +336,231 @@ void SAL_CALL ODriver::release() throw(::com::sun::star::uno::RuntimeException)
ODriver_BASE::release();
}
// -----------------------------------------------------------------------------
+void* ODriver::getOdbcFunction(sal_Int32 _nIndex) const
+{
+ void* pFunction = NULL;
+ switch(_nIndex)
+ {
+ case ODBC3SQLAllocHandle:
+ pFunction = pODBC3SQLAllocHandle;;
+ break;
+ case ODBC3SQLConnect:
+ pFunction = pODBC3SQLConnect;
+ break;
+ case ODBC3SQLDriverConnect:
+ pFunction = pODBC3SQLDriverConnect;
+ break;
+ case ODBC3SQLBrowseConnect:
+ pFunction = pODBC3SQLBrowseConnect;
+ break;
+ case ODBC3SQLDataSources:
+ pFunction = pODBC3SQLDataSources;
+ break;
+ case ODBC3SQLDrivers:
+ pFunction = pODBC3SQLDrivers;
+ break;
+ case ODBC3SQLGetInfo:
+
+ pFunction = pODBC3SQLGetInfo;
+ break;
+ case ODBC3SQLGetFunctions:
+
+ pFunction = pODBC3SQLGetFunctions;
+ break;
+ case ODBC3SQLGetTypeInfo:
+
+ pFunction = pODBC3SQLGetTypeInfo;
+ break;
+ case ODBC3SQLSetConnectAttr:
+
+ pFunction = pODBC3SQLSetConnectAttr;
+ break;
+ case ODBC3SQLGetConnectAttr:
+
+ pFunction = pODBC3SQLGetConnectAttr;
+ break;
+ case ODBC3SQLSetEnvAttr:
+
+ pFunction = pODBC3SQLSetEnvAttr;
+ break;
+ case ODBC3SQLGetEnvAttr:
+
+ pFunction = pODBC3SQLGetEnvAttr;
+ break;
+ case ODBC3SQLSetStmtAttr:
+
+ pFunction = pODBC3SQLSetStmtAttr;
+ break;
+ case ODBC3SQLGetStmtAttr:
+
+ pFunction = pODBC3SQLGetStmtAttr;
+ break;
+ case ODBC3SQLPrepare:
+
+ pFunction = pODBC3SQLPrepare;
+ break;
+ case ODBC3SQLBindParameter:
+
+ pFunction = pODBC3SQLBindParameter;
+ break;
+ case ODBC3SQLSetCursorName:
+
+ pFunction = pODBC3SQLSetCursorName;
+ break;
+ case ODBC3SQLExecute:
+
+ pFunction = pODBC3SQLExecute;
+ break;
+ case ODBC3SQLExecDirect:
+
+ pFunction = pODBC3SQLExecDirect;
+ break;
+ case ODBC3SQLDescribeParam:
+
+ pFunction = pODBC3SQLDescribeParam;
+ break;
+ case ODBC3SQLNumParams:
+
+ pFunction = pODBC3SQLNumParams;
+ break;
+ case ODBC3SQLParamData:
+
+ pFunction = pODBC3SQLParamData;
+ break;
+ case ODBC3SQLPutData:
+
+ pFunction = pODBC3SQLPutData;
+ break;
+ case ODBC3SQLRowCount:
+
+ pFunction = pODBC3SQLRowCount;
+ break;
+ case ODBC3SQLNumResultCols:
+
+ pFunction = pODBC3SQLNumResultCols;
+ break;
+ case ODBC3SQLDescribeCol:
+
+ pFunction = pODBC3SQLDescribeCol;
+ break;
+ case ODBC3SQLColAttribute:
+
+ pFunction = pODBC3SQLColAttribute;
+ break;
+ case ODBC3SQLBindCol:
+
+ pFunction = pODBC3SQLBindCol;
+ break;
+ case ODBC3SQLFetch:
+
+ pFunction = pODBC3SQLFetch;
+ break;
+ case ODBC3SQLFetchScroll:
+
+ pFunction = pODBC3SQLFetchScroll;
+ break;
+ case ODBC3SQLGetData:
+
+ pFunction = pODBC3SQLGetData;
+ break;
+ case ODBC3SQLSetPos:
+
+ pFunction = pODBC3SQLSetPos;
+ break;
+ case ODBC3SQLBulkOperations:
+
+ pFunction = pODBC3SQLBulkOperations;
+ break;
+ case ODBC3SQLMoreResults:
+
+ pFunction = pODBC3SQLMoreResults;
+ break;
+ case ODBC3SQLGetDiagRec:
+
+ pFunction = pODBC3SQLGetDiagRec;
+ break;
+ case ODBC3SQLColumnPrivileges:
+
+ pFunction = pODBC3SQLColumnPrivileges;
+ break;
+ case ODBC3SQLColumns:
+
+ pFunction = pODBC3SQLColumns;
+ break;
+ case ODBC3SQLForeignKeys:
+
+ pFunction = pODBC3SQLForeignKeys;
+ break;
+ case ODBC3SQLPrimaryKeys:
+
+ pFunction = pODBC3SQLPrimaryKeys;
+ break;
+ case ODBC3SQLProcedureColumns:
+
+ pFunction = pODBC3SQLProcedureColumns;
+ break;
+ case ODBC3SQLProcedures:
+
+ pFunction = pODBC3SQLProcedures;
+ break;
+ case ODBC3SQLSpecialColumns:
+
+ pFunction = pODBC3SQLSpecialColumns;
+ break;
+ case ODBC3SQLStatistics:
+
+ pFunction = pODBC3SQLStatistics;
+ break;
+ case ODBC3SQLTablePrivileges:
+
+ pFunction = pODBC3SQLTablePrivileges;
+ break;
+ case ODBC3SQLTables:
+
+ pFunction = pODBC3SQLTables;
+ break;
+ case ODBC3SQLFreeStmt:
+
+ pFunction = pODBC3SQLFreeStmt;
+ break;
+ case ODBC3SQLCloseCursor:
+
+ pFunction = pODBC3SQLCloseCursor;
+ break;
+ case ODBC3SQLCancel:
+
+ pFunction = pODBC3SQLCancel;
+ break;
+ case ODBC3SQLEndTran:
+
+ pFunction = pODBC3SQLEndTran;
+ break;
+ case ODBC3SQLDisconnect:
+
+ pFunction = pODBC3SQLDisconnect;
+ break;
+ case ODBC3SQLFreeHandle:
+
+ pFunction = pODBC3SQLFreeHandle;
+ break;
+ case ODBC3SQLGetCursorName:
+
+ pFunction = pODBC3SQLGetCursorName;
+ break;
+ case ODBC3SQLNativeSql:
+
+ pFunction = pODBC3SQLNativeSql;
+ break;
+ default:
+ OSL_ENSURE(0,"Function unknown!");
+ }
+ return pFunction;
+}
+// -----------------------------------------------------------------------------
+ }
+}
+// -----------------------------------------------------------------------------
+
+
diff --git a/connectivity/source/drivers/adabas/BResultSet.cxx b/connectivity/source/drivers/adabas/BResultSet.cxx
index 031dc7fe0e05..8c06666d3f3c 100644
--- a/connectivity/source/drivers/adabas/BResultSet.cxx
+++ b/connectivity/source/drivers/adabas/BResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BResultSet.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-01-22 07:21:01 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,8 +87,8 @@ using namespace com::sun::star::util;
sal_Bool SAL_CALL OAdabasResultSet::next( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_nLastColumnPos = 0;
// m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_NEXT,0);
@@ -97,15 +97,15 @@ sal_Bool SAL_CALL OAdabasResultSet::next( ) throw(SQLException, RuntimeExceptio
if(m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO)
++m_nRowPos;
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
}
// -----------------------------------------------------------------------------
sal_Bool SAL_CALL OAdabasResultSet::first( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_nLastColumnPos = 0;
// don't ask why !
@@ -119,7 +119,7 @@ sal_Bool SAL_CALL OAdabasResultSet::first( ) throw(SQLException, RuntimeExcepti
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
}
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
if(bRet = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO))
m_nRowPos = 1;
return bRet;
@@ -129,8 +129,8 @@ sal_Bool SAL_CALL OAdabasResultSet::first( ) throw(SQLException, RuntimeExcepti
sal_Bool SAL_CALL OAdabasResultSet::last( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_nLastColumnPos = 0;
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
@@ -144,7 +144,7 @@ sal_Bool SAL_CALL OAdabasResultSet::last( ) throw(SQLException, RuntimeExceptio
}
m_bEOF = sal_True;
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
// here I know definitely that I stand on the last record
return m_bLastRecord = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO);
}
@@ -152,8 +152,8 @@ sal_Bool SAL_CALL OAdabasResultSet::last( ) throw(SQLException, RuntimeExceptio
sal_Bool SAL_CALL OAdabasResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_nLastColumnPos = 0;
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
@@ -167,7 +167,7 @@ sal_Bool SAL_CALL OAdabasResultSet::absolute( sal_Int32 row ) throw(SQLException
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
}
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
if(bRet)
m_nRowPos = row;
return bRet;
@@ -176,8 +176,8 @@ sal_Bool SAL_CALL OAdabasResultSet::absolute( sal_Int32 row ) throw(SQLException
sal_Bool SAL_CALL OAdabasResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_nLastColumnPos = 0;
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
@@ -190,7 +190,7 @@ sal_Bool SAL_CALL OAdabasResultSet::relative( sal_Int32 row ) throw(SQLException
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
}
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
if(bRet)
m_nRowPos += row;
return bRet;
@@ -199,8 +199,8 @@ sal_Bool SAL_CALL OAdabasResultSet::relative( sal_Int32 row ) throw(SQLException
sal_Bool SAL_CALL OAdabasResultSet::previous( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
m_nLastColumnPos = 0;
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
@@ -213,7 +213,7 @@ sal_Bool SAL_CALL OAdabasResultSet::previous( ) throw(SQLException, RuntimeExce
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
}
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
if(bRet || m_nCurrentFetchState == SQL_NO_DATA)
--m_nRowPos;
return bRet;
@@ -222,8 +222,8 @@ sal_Bool SAL_CALL OAdabasResultSet::previous( ) throw(SQLException, RuntimeExce
void SAL_CALL OAdabasResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (OResultSet_BASE::rBHelper.bDisposed)
- throw DisposedException();
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
// SQLRETURN nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_REFRESH,SQL_LOCK_NO_CHANGE);
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_OFF,SQL_IS_UINTEGER);
@@ -235,7 +235,7 @@ void SAL_CALL OAdabasResultSet::refreshRow( ) throw(SQLException, RuntimeExcept
N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_RETRIEVE_DATA,(SQLPOINTER)SQL_RD_ON,SQL_IS_UINTEGER);
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
}
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/adabas/BTables.cxx b/connectivity/source/drivers/adabas/BTables.cxx
index 756049e742f4..bb44babcb402 100644
--- a/connectivity/source/drivers/adabas/BTables.cxx
+++ b/connectivity/source/drivers/adabas/BTables.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BTables.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:48:18 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -279,7 +279,13 @@ void OTables::createTable( const Reference< XPropertySet >& descriptor )
if(sSchema.getLength())
aSql += ::dbtools::quoteName(aQuote, sSchema) + aDot;
else
- descriptor->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME),makeAny(static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getUserName().toAsciiUpperCase()));
+ descriptor->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCHEMANAME),makeAny(static_cast<OAdabasCatalog&>(m_rParent).getConnection()->getUserName().
+#if SUPD > 631
+ toAsciiUpperCase()
+#else
+ toUpperCase()
+#endif
+ ));
aSql += ::dbtools::quoteName(aQuote, getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))))
+ ::rtl::OUString::createFromAscii(" (");
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index 0d54d9766c43..0bb4bbf65472 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.17 $
+# $Revision: 1.18 $
#
-# last change: $Author: oj $ $Date: 2001-05-14 11:48:18 $
+# last change: $Author: oj $ $Date: 2001-05-15 08:18:12 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -79,6 +79,7 @@ ENVCFLAGS+=/FR$(SLO)$/
# --- Files -------------------------------------
SLOFILES=\
+ $(SLO)$/BFunctions.obj \
$(SLO)$/BConnection.obj \
$(SLO)$/BDriver.obj \
$(SLO)$/BCatalog.obj \
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index e1d04f09e942..a4812b36970b 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OConnection.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:37:35 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -133,7 +133,11 @@ void SAL_CALL OConnection::release() throw(RuntimeException)
{
relase_ChildImpl();
}
-
+// -----------------------------------------------------------------------------
+void* OConnection::getOdbcFunction(sal_Int32 _nIndex) const
+{
+ return m_pDriver->getOdbcFunction(_nIndex);
+}
//-----------------------------------------------------------------------------
SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, sal_Bool bSilent)
{
@@ -187,7 +191,7 @@ SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int
try
{
::rtl::OUString aVal;
- OTools::GetInfo(m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding());
+ OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aVal,*this,getTextEncoding());
bReadOnly = !aVal.compareToAscii("Y");
}
catch(...)
@@ -279,7 +283,7 @@ SQLRETURN OConnection::Construct(const ::rtl::OUString& url,const Sequence< Prop
SQLRETURN nSQLRETURN = OpenConnection(aDSN,nTimeout, bSilent);
if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)
{
- OTools::ThrowException(nSQLRETURN,m_aConnectionHandle,SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(this,nSQLRETURN,m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
else if(SQL_SUCCESS_WITH_INFO == nSQLRETURN) // this driver does not support odbc3
{
@@ -330,7 +334,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::
::rtl::OString aSql(::rtl::OUStringToOString(sql.getStr(),getTextEncoding()));
char pOut[2048];
SQLINTEGER nOutLen;
- OTools::ThrowException(N3SQLNativeSql(m_aConnectionHandle,(SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength(),(SDB_ODBC_CHAR*)pOut,2048,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(this,N3SQLNativeSql(m_aConnectionHandle,(SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength(),(SDB_ODBC_CHAR*)pOut,2048,&nOutLen),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
return ::rtl::OUString(pOut,nOutLen,getTextEncoding());
}
// --------------------------------------------------------------------------------
@@ -340,7 +344,7 @@ void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) throw(SQLExcepti
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OTools::ThrowException(N3SQLSetConnectAttr(m_aConnectionHandle,
+ OTools::ThrowException(this,N3SQLSetConnectAttr(m_aConnectionHandle,
SQL_ATTR_AUTOCOMMIT,
(SQLPOINTER)((autoCommit) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF) ,SQL_IS_INTEGER),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
@@ -353,7 +357,7 @@ sal_Bool SAL_CALL OConnection::getAutoCommit( ) throw(SQLException, RuntimeExce
sal_uInt32 nOption = 0;
- OTools::ThrowException(N3SQLGetConnectAttr(m_aConnectionHandle,
+ OTools::ThrowException(this,N3SQLGetConnectAttr(m_aConnectionHandle,
SQL_ATTR_AUTOCOMMIT, &nOption,0,0),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
return nOption == SQL_AUTOCOMMIT_ON ;
}
@@ -364,7 +368,7 @@ void SAL_CALL OConnection::commit( ) throw(SQLException, RuntimeException)
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OTools::ThrowException(N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_COMMIT),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(this,N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_COMMIT),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
// --------------------------------------------------------------------------------
void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
@@ -373,7 +377,7 @@ void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OTools::ThrowException(N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_ROLLBACK),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(this,N3SQLEndTran(SQL_HANDLE_DBC,m_aConnectionHandle,SQL_ROLLBACK),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
// --------------------------------------------------------------------------------
sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException)
@@ -405,7 +409,7 @@ void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException,
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OTools::ThrowException(
+ OTools::ThrowException(this,
N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_ACCESS_MODE,(SQLPOINTER)readOnly,SQL_IS_INTEGER),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
@@ -417,7 +421,7 @@ sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeExcepti
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aValue,*this,getTextEncoding());
+ OTools::GetInfo(this,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,aValue,*this,getTextEncoding());
return !aValue.compareToAscii("Y");
}
// --------------------------------------------------------------------------------
@@ -428,7 +432,7 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
::rtl::OString aCat(::rtl::OUStringToOString(catalog.getStr(),getTextEncoding()));
- OTools::ThrowException(
+ OTools::ThrowException(this,
N3SQLSetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,(SDB_ODBC_CHAR*)aCat.getStr(),SQL_NTS),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
}
@@ -441,7 +445,7 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
sal_Int32 nValueLen;
char pCat[1024];
- OTools::ThrowException(
+ OTools::ThrowException(this,
N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_CURRENT_CATALOG,(SDB_ODBC_CHAR*)pCat,1024,&nValueLen),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
@@ -454,7 +458,7 @@ void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) throw(SQLE
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OTools::ThrowException(N3SQLSetConnectAttr(m_aConnectionHandle,
+ OTools::ThrowException(this,N3SQLSetConnectAttr(m_aConnectionHandle,
SQL_ATTR_TXN_ISOLATION,
(SQLPOINTER)level,SQL_IS_INTEGER),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
@@ -468,7 +472,7 @@ sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException,
sal_Int32 nTxn = 0;
SQLINTEGER nValueLen;
- OTools::ThrowException(
+ OTools::ThrowException(this,
N3SQLGetConnectAttr(m_aConnectionHandle,SQL_ATTR_TXN_ISOLATION,&nTxn,sizeof nTxn,&nValueLen),
m_aConnectionHandle,SQL_HANDLE_DBC,*this);
return nTxn;
@@ -536,7 +540,7 @@ void OConnection::buildTypeInfo() throw( SQLException)
aInfo.aLocalTypeName = xRow->getString (13);
aInfo.nMinimumScale = xRow->getShort (14);
aInfo.nMaximumScale = xRow->getShort (15);
- aInfo.nNumPrecRadix = xRow->getInt (18);
+ aInfo.nNumPrecRadix = (sal_Int16)xRow->getInt(18);
@@ -567,7 +571,7 @@ void OConnection::disposing()
}
m_aStatements.clear();
- OTools::ThrowException(N3SQLDisconnect(m_aConnectionHandle),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(this,N3SQLDisconnect(m_aConnectionHandle),m_aConnectionHandle,SQL_HANDLE_DBC,*this);
m_bClosed = sal_True;
m_xMetaData = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData>();
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
index c8f137c3f92f..f2297c9d5b62 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaData.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: oj $ $Date: 2001-04-20 13:29:51 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,6 +97,7 @@ ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon
,m_pConnection(_pCon)
,m_bUseCatalog(sal_True)
{
+ OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
if(!m_pConnection->isCatalogUsed())
{
osl_incrementInterlockedCount( &m_refCount );
@@ -113,9 +114,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo( ) throw(SQLExc
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openTypeInfo();
return xRef;
@@ -134,9 +135,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLExc
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
xRef = pResult;
pResult->openCatalogs();
}
@@ -147,7 +148,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLExc
{
::rtl::OUString aVal;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_NAME_SEPARATOR,aVal,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_NAME_SEPARATOR,aVal,*this,m_pConnection->getTextEncoding());
return aVal;
}
@@ -156,9 +157,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLExce
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openSchemas();
return xRef;
@@ -170,9 +171,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openColumnPrivileges(m_bUseCatalog ? catalog : Any(),schema,table,columnNamePattern);
return xRef;
@@ -184,9 +185,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,columnNamePattern);
return xRef;
@@ -198,9 +199,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openTables(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,types);
return xRef;
@@ -212,9 +213,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openProcedureColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern,columnNamePattern);
return xRef;
@@ -226,9 +227,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openProcedures(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern);
return xRef;
@@ -239,9 +240,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openVersionColumns(m_bUseCatalog ? catalog : Any(),schema,table);
return xRef;
@@ -250,84 +251,84 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_BINARY_LITERAL_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_BINARY_LITERAL_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_ROW_SIZE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_CATALOG_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CATALOG_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_CHAR_LITERAL_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CHAR_LITERAL_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_COLUMN_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMN_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_COLUMNS_IN_INDEX,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_INDEX,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_CURSOR_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CURSOR_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ACTIVE_CONNECTIONS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACTIVE_CONNECTIONS,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_COLUMNS_IN_TABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_TABLE,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_STATEMENT_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_STATEMENT_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_TABLE_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLE_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTablesInSelect( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_TABLES_IN_SELECT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLES_IN_SELECT,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
@@ -336,9 +337,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openExportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
return xRef;
@@ -349,9 +350,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openImportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
return xRef;
@@ -362,9 +363,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openPrimaryKeys(m_bUseCatalog ? catalog : Any(),schema,table);
return xRef;
@@ -376,9 +377,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openIndexInfo(m_bUseCatalog ? catalog : Any(),schema,table,unique,approximate);
return xRef;
@@ -390,9 +391,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openBestRowIdentifier(m_bUseCatalog ? catalog : Any(),schema,table,scope,nullable);
return xRef;
@@ -403,9 +404,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openTablePrivileges(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern);
return xRef;
@@ -418,9 +419,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
{
SQLHANDLE hStmt;
SQLRETURN nRetcode = N3SQLAllocHandle(SQL_HANDLE_STMT,m_pConnection->getConnection(),&hStmt);
- OTools::ThrowException(nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_pConnection->getConnection(),SQL_HANDLE_DBC,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(hStmt,m_pConnection->getTextEncoding());
+ ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection,hStmt,m_pConnection->getTextEncoding());
Reference< XResultSet > xRef = pResult;
pResult->openForeignKeys(m_bUseCatalog ? primaryCatalog : Any(),primarySchema.toChar() == '%' ? &primarySchema : NULL,&primaryTable,
m_bUseCatalog ? foreignCatalog : Any(), foreignSchema.toChar() == '%' ? &foreignSchema : NULL,&foreignTable);
@@ -430,77 +431,77 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aVal;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_ROW_SIZE_INCLUDES_LONG,aVal,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE_INCLUDES_LONG,aVal,*this,m_pConnection->getTextEncoding());
return aVal.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_LOWER;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_LOWER;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_MIXED;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_MIXED;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_UPPER;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_UPPER;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
return nValue == SQL_AT_ADD_COLUMN;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
return nValue == SQL_AT_DROP_COLUMN;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_INDEX_SIZE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_INDEX_SIZE,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_NON_NULLABLE_COLUMNS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NON_NULLABLE_COLUMNS,nValue,*this);
return nValue == SQL_NNC_NON_NULL;
}
// -------------------------------------------------------------------------
@@ -508,28 +509,28 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLExc
{
::rtl::OUString aVal;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_TERM,aVal,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_TERM,aVal,*this,m_pConnection->getTextEncoding());
return aVal;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getIdentifierQuoteString( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aVal;
- OTools::GetInfo(m_aConnectionHandle,SQL_IDENTIFIER_QUOTE_CHAR,aVal,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_QUOTE_CHAR,aVal,*this,m_pConnection->getTextEncoding());
return aVal;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aVal;
- OTools::GetInfo(m_aConnectionHandle,SQL_SPECIAL_CHARACTERS,aVal,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SPECIAL_CHARACTERS,aVal,*this,m_pConnection->getTextEncoding());
return aVal;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
return nValue != SQL_CN_NONE;
}
// -------------------------------------------------------------------------
@@ -537,126 +538,126 @@ sal_Bool SAL_CALL ODatabaseMetaData::isCatalogAtStart( ) throw(SQLException, Ru
{
sal_Int32 nValue=0;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_LOCATION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_LOCATION,nValue,*this);
return nValue == SQL_CL_START;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
return nValue == SQL_TC_DDL_IGNORE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
return nValue == SQL_TC_DDL_COMMIT;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
return nValue == SQL_TC_DML;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
return nValue == SQL_TC_ALL;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
return (nValue & SQL_CA1_POS_DELETE) == SQL_CA1_POS_DELETE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
return (nValue & SQL_CA1_POS_UPDATE) == SQL_CA1_POS_UPDATE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
return nValue == SQL_CB_PRESERVE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
return nValue == SQL_CB_PRESERVE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TXN_ISOLATION_OPTION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_ISOLATION_OPTION,nValue,*this);
return (nValue & level) == level;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInDataManipulation( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
return (nValue & SQL_SU_DML_STATEMENTS) == SQL_SU_DML_STATEMENTS;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
return nValue == SQL_SC_SQL92_FULL;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
return nValue == SQL_SC_SQL92_ENTRY;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aStr;
- OTools::GetInfo(m_aConnectionHandle,SQL_INTEGRITY,aStr,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_INTEGRITY,aStr,*this,m_pConnection->getTextEncoding());
return aStr.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
return (nValue & SQL_SU_INDEX_DEFINITION) == SQL_SU_INDEX_DEFINITION;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInTableDefinitions( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
return (nValue & SQL_SU_TABLE_DEFINITION) == SQL_SU_TABLE_DEFINITION;
}
// -------------------------------------------------------------------------
@@ -664,7 +665,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInTableDefinitions( ) thro
{
sal_Int32 nValue=0;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
return (nValue & SQL_CU_TABLE_DEFINITION) == SQL_CU_TABLE_DEFINITION;
}
// -------------------------------------------------------------------------
@@ -672,7 +673,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) thro
{
sal_Int32 nValue=0;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
return (nValue & SQL_CU_INDEX_DEFINITION) == SQL_CU_INDEX_DEFINITION;
}
// -------------------------------------------------------------------------
@@ -680,14 +681,14 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInDataManipulation( ) thro
{
sal_Int32 nValue=0;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
return (nValue & SQL_CU_DML_STATEMENTS) == SQL_CU_DML_STATEMENTS;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
return ((nValue & SQL_OJ_FULL|SQL_OJ_LEFT|SQL_OJ_RIGHT|SQL_OJ_NESTED|SQL_OJ_NOT_ORDERED|SQL_OJ_ALL_COMPARISON_OPS|SQL_OJ_INNER) != 0);
}
// -------------------------------------------------------------------------
@@ -709,7 +710,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLE
Reference< XResultSet > xRef = pResult;
pResult->setTableTypes();
sal_Int32 nValue = 0;
- OTools::GetInfo(m_aConnectionHandle,SQL_CREATE_VIEW,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CREATE_VIEW,nValue,*this);
sal_Bool bViewsSupported = (nValue & SQL_CV_CREATE_VIEW) == SQL_CV_CREATE_VIEW;
ORows aRows;
@@ -733,105 +734,105 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLE
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatements( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_CONCURRENT_ACTIVITIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CONCURRENT_ACTIVITIES,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_PROCEDURE_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_PROCEDURE_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_SCHEMA_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_SCHEMA_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
return nValue != SQL_TC_NONE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ACCESSIBLE_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
return (nValue & SQL_CA1_POSITIONED_UPDATE) == SQL_CA1_POSITIONED_UPDATE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ACCESSIBLE_TABLES,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_TABLES,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
{
sal_Bool bValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,bValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_READ_ONLY,bValue,*this);
return bValue;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
return nValue == SQL_FILE_CATALOG;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
return nValue == SQL_FILE_TABLE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_FUNCTIONS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FUNCTIONS,nValue,*this);
return (nValue & SQL_FN_CVT_CONVERT) == SQL_FN_CVT_CONVERT;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CONCAT_NULL_BEHAVIOR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONCAT_NULL_BEHAVIOR,nValue,*this);
return nValue == SQL_CB_NULL;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_COLUMN_ALIAS,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_COLUMN_ALIAS,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
return nValue != SQL_CN_NONE;
}
// -------------------------------------------------------------------------
@@ -844,88 +845,88 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_In
switch(fromType)
{
case DataType::BIT:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_BIT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIT,nValue,*this);
break;
case DataType::TINYINT:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_TINYINT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TINYINT,nValue,*this);
break;
case DataType::SMALLINT:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_SMALLINT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_SMALLINT,nValue,*this);
break;
case DataType::INTEGER:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_INTEGER,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_INTEGER,nValue,*this);
break;
case DataType::BIGINT:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_BIGINT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIGINT,nValue,*this);
break;
case DataType::FLOAT:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_FLOAT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FLOAT,nValue,*this);
break;
case DataType::REAL:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_REAL,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_REAL,nValue,*this);
break;
case DataType::DOUBLE:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_DOUBLE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DOUBLE,nValue,*this);
break;
case DataType::NUMERIC:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_NUMERIC,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_NUMERIC,nValue,*this);
break;
case DataType::DECIMAL:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_DECIMAL,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DECIMAL,nValue,*this);
break;
case DataType::CHAR:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_CHAR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_CHAR,nValue,*this);
break;
case DataType::VARCHAR:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_VARCHAR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARCHAR,nValue,*this);
break;
case DataType::LONGVARCHAR:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_LONGVARCHAR,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARCHAR,nValue,*this);
break;
case DataType::DATE:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_DATE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DATE,nValue,*this);
break;
case DataType::TIME:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_TIME,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIME,nValue,*this);
break;
case DataType::TIMESTAMP:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_TIMESTAMP,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIMESTAMP,nValue,*this);
break;
case DataType::BINARY:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_BINARY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BINARY,nValue,*this);
break;
case DataType::VARBINARY:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_VARBINARY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARBINARY,nValue,*this);
break;
case DataType::LONGVARBINARY:
- OTools::GetInfo(m_aConnectionHandle,SQL_CONVERT_LONGVARBINARY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARBINARY,nValue,*this);
break;
case DataType::SQLNULL:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::OTHER:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::OBJECT:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::DISTINCT:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::STRUCT:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::ARRAY:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::BLOB:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::CLOB:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
case DataType::REF:
- // OTools::GetInfo(m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
+ // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
break;
}
sal_Bool bConvert = sal_False;
@@ -996,126 +997,126 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_In
sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_EXPRESSIONS_IN_ORDERBY,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_EXPRESSIONS_IN_ORDERBY,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
return nValue != SQL_GB_NOT_SUPPORTED;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
return nValue != SQL_GB_GROUP_BY_CONTAINS_SELECT;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
return nValue == SQL_GB_NO_RELATION;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MULTIPLE_ACTIVE_TXN,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULTIPLE_ACTIVE_TXN,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MULT_RESULT_SETS,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULT_RESULT_SETS,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_LIKE_ESCAPE_CLAUSE,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_LIKE_ESCAPE_CLAUSE,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'Y';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding());
return aValue.toChar() == 'N';
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_UNION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
return (nValue & SQL_U_UNION) == SQL_U_UNION;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_UNION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
return (nValue & SQL_U_UNION_ALL) == SQL_U_UNION_ALL;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_MIXED;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
return nValue == SQL_IC_MIXED;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
return nValue == SQL_NC_END;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
return nValue == SQL_NC_START;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
return nValue == SQL_NC_HIGH;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
return nValue == SQL_NC_LOW;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
return (nValue & SQL_SU_PROCEDURE_INVOCATION) == SQL_SU_PROCEDURE_INVOCATION;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
return (nValue & SQL_SU_PRIVILEGE_DEFINITION) == SQL_SU_PRIVILEGE_DEFINITION;
}
// -------------------------------------------------------------------------
@@ -1123,7 +1124,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(
{
sal_Int32 nValue=0;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
return (nValue & SQL_CU_PROCEDURE_INVOCATION) == SQL_CU_PROCEDURE_INVOCATION;
}
// -------------------------------------------------------------------------
@@ -1131,140 +1132,140 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( )
{
sal_Int32 nValue=0;
if(m_bUseCatalog)
- OTools::GetInfo(m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
return (nValue & SQL_CU_PRIVILEGE_DEFINITION) == SQL_CU_PRIVILEGE_DEFINITION;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
return (nValue & SQL_SQ_CORRELATED_SUBQUERIES) == SQL_SQ_CORRELATED_SUBQUERIES;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
return (nValue & SQL_SQ_COMPARISON) == SQL_SQ_COMPARISON;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
return (nValue & SQL_SQ_EXISTS) == SQL_SQ_EXISTS;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
return (nValue & SQL_SQ_IN) == SQL_SQ_IN;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
return (nValue & SQL_SQ_QUANTIFIED) == SQL_SQ_QUANTIFIED;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
return nValue == SQL_SC_SQL92_INTERMEDIATE;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue = ::rtl::OUString::createFromAscii("sdbc:odbc:");
- OTools::GetInfo(m_aConnectionHandle,SQL_DATA_SOURCE_NAME,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_NAME,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_USER_NAME,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_USER_NAME,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DRIVER_NAME,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_NAME,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DRIVER_ODBC_VER,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DBMS_NAME,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DBMS_NAME,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_PROCEDURE_TERM,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURE_TERM,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SCHEMA_TERM,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_TERM,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
return aValue.copy(0,aValue.indexOf('.')).toInt32();
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
return aValue.copy(0,aValue.lastIndexOf('.')).toInt32();
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_KEYWORDS,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_KEYWORDS,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
{
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SEARCH_PATTERN_ESCAPE,aValue,*this,m_pConnection->getTextEncoding());
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SEARCH_PATTERN_ESCAPE,aValue,*this,m_pConnection->getTextEncoding());
return aValue;
}
// -------------------------------------------------------------------------
@@ -1272,7 +1273,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeExc
{
sal_Int32 nValue;
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_STR_ASCII)
aValue = ::rtl::OUString::createFromAscii("ASCII,");
if(nValue & SQL_FN_STR_BIT_LENGTH)
@@ -1330,7 +1331,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeExc
{
sal_Int32 nValue;
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_TD_CURRENT_DATE)
aValue = ::rtl::OUString::createFromAscii("CURRENT_DATE,");
@@ -1382,7 +1383,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeExc
{
sal_Int32 nValue;
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_SYS_DBNAME)
aValue += ::rtl::OUString::createFromAscii("DBNAME,");
@@ -1398,7 +1399,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeExc
{
sal_Int32 nValue;
::rtl::OUString aValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this);
if(nValue & SQL_FN_NUM_ABS)
aValue += ::rtl::OUString::createFromAscii("ABS,");
@@ -1456,28 +1457,28 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeExc
sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
return nValue == SQL_OIC_LEVEL2;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
return nValue == SQL_OIC_CORE;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
return nValue == SQL_OIC_LEVEL1;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
return (nValue & SQL_OJ_FULL) == SQL_OJ_FULL;
}
// -------------------------------------------------------------------------
@@ -1489,35 +1490,35 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLExce
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_COLUMNS_IN_GROUP_BY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_GROUP_BY,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_COLUMNS_IN_ORDER_BY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_ORDER_BY,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_COLUMNS_IN_SELECT,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_SELECT,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_MAX_USER_NAME_LEN,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_USER_NAME_LEN,nValue,*this);
return nValue;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
{
sal_Int32 nValue;
- OTools::GetInfo(m_aConnectionHandle,SQL_CURSOR_SENSITIVITY,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_SENSITIVITY,nValue,*this);
return (nValue & setType) == setType;
}
// -------------------------------------------------------------------------
@@ -1538,7 +1539,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 set
break;
}
- OTools::GetInfo(m_aConnectionHandle,nAskFor,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
sal_Bool bRet = sal_False;
switch(concurrency)
{
@@ -1569,7 +1570,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) t
break;
}
- OTools::GetInfo(m_aConnectionHandle,nAskFor,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
return (nValue & SQL_CA2_SENSITIVITY_UPDATES) == SQL_CA2_SENSITIVITY_UPDATES;
}
// -------------------------------------------------------------------------
@@ -1590,7 +1591,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) t
break;
}
- OTools::GetInfo(m_aConnectionHandle,nAskFor,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) == SQL_CA2_SENSITIVITY_DELETIONS;
}
// -------------------------------------------------------------------------
@@ -1611,7 +1612,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) t
break;
}
- OTools::GetInfo(m_aConnectionHandle,nAskFor,nValue,*this);
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == SQL_CA2_SENSITIVITY_ADDITIONS;
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index ca712a7101f7..3e777729f747 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaDataResultSet.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:50:18 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -116,7 +116,7 @@ using namespace com::sun::star::sdbc;
using namespace com::sun::star::util;
// -------------------------------------------------------------------------
-ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(SQLHANDLE _pStatementHandle,rtl_TextEncoding _nTextEncoding) : ODatabaseMetaDataResultSet_BASE(m_aMutex)
+ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(OConnection* _pConnection,SQLHANDLE _pStatementHandle,rtl_TextEncoding _nTextEncoding) : ODatabaseMetaDataResultSet_BASE(m_aMutex)
,OPropertySetHelper(ODatabaseMetaDataResultSet_BASE::rBHelper)
,m_aStatement(NULL)
,m_xMetaData(NULL)
@@ -124,7 +124,9 @@ ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(SQLHANDLE _pStatementHand
,m_bEOF(sal_False)
,m_nTextEncoding(_nTextEncoding)
,m_bFreeHandle(sal_False)
+ ,m_pConnection(_pConnection)
{
+ OSL_ENSURE(m_pConnection,"ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet: No parent set!");
osl_incrementInterlockedCount( &m_refCount );
m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
osl_decrementInterlockedCount( &m_refCount );
@@ -208,7 +210,12 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const ::rtl::OUString
sal_Int32 nLen = xMeta->getColumnCount();
sal_Int32 i = 1;
for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
+ if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
+#if SUPD > 630
+ columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
+#else
+ columnName.equalsIgnoreCase(xMeta->getColumnName(i)))
+#endif
break;
return i;
}
@@ -251,7 +258,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::getBoolean( sal_Int32 columnIndex
case DataType::BIT:
{
sal_Int8 nValue = 0;
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_BIT,m_bWasNull,**this,&nValue,sizeof nValue);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_BIT,m_bWasNull,**this,&nValue,sizeof nValue);
bRet = nValue != 0;
}
break;
@@ -271,7 +278,7 @@ sal_Int8 SAL_CALL ODatabaseMetaDataResultSet::getByte( sal_Int32 columnIndex ) t
columnIndex = mapColumn(columnIndex);
sal_Int8 nVal = 0;
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_CHAR,m_bWasNull,**this,&nVal,sizeof nVal);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_CHAR,m_bWasNull,**this,&nVal,sizeof nVal);
if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
return sal_Int8((*m_aValueRangeIter).second[(sal_Int32)nVal]);
@@ -287,18 +294,18 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
columnIndex = mapColumn(columnIndex);
- sal_Int32 nType = getMetaData()->getColumnType(columnIndex);
+ SWORD nType = getMetaData()->getColumnType(columnIndex);
switch(nType)
{
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
- ::rtl::OUString aRet = OTools::getStringValue(m_aStatementHandle,(SQLUSMALLINT)columnIndex,getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
+ ::rtl::OUString aRet = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,nType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
break;
}
- return OTools::getBytesValue(m_aStatementHandle,(SQLUSMALLINT)columnIndex,nType,m_bWasNull,**this);
+ return OTools::getBytesValue(m_pConnection,m_aStatementHandle,columnIndex,nType,m_bWasNull,**this);
}
// -------------------------------------------------------------------------
@@ -313,7 +320,7 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
aDate.day = 0;
aDate.month = 0;
aDate.year = 0;
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
return Date(aDate.day,aDate.month,aDate.year);
}
// -------------------------------------------------------------------------
@@ -327,7 +334,7 @@ double SAL_CALL ODatabaseMetaDataResultSet::getDouble( sal_Int32 columnIndex ) t
columnIndex = mapColumn(columnIndex);
double nValue(0.0);
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_DOUBLE,m_bWasNull,**this,&nValue,sizeof nValue);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_DOUBLE,m_bWasNull,**this,&nValue,sizeof nValue);
return nValue;
}
// -------------------------------------------------------------------------
@@ -341,7 +348,7 @@ float SAL_CALL ODatabaseMetaDataResultSet::getFloat( sal_Int32 columnIndex ) thr
columnIndex = mapColumn(columnIndex);
float nVal(0);
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_FLOAT,m_bWasNull,**this,&nVal,sizeof nVal);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_FLOAT,m_bWasNull,**this,&nVal,sizeof nVal);
return nVal;
}
// -------------------------------------------------------------------------
@@ -355,7 +362,7 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::getInt( sal_Int32 columnIndex ) t
columnIndex = mapColumn(columnIndex);
sal_Int32 nVal = 0;
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_LONG,m_bWasNull,**this,&nVal,sizeof nVal);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_LONG,m_bWasNull,**this,&nVal,sizeof nVal);
if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
return (*m_aValueRangeIter).second[(sal_Int32)nVal];
@@ -390,7 +397,7 @@ Reference< XResultSetMetaData > SAL_CALL ODatabaseMetaDataResultSet::getMetaData
checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
::osl::MutexGuard aGuard( m_aMutex );
- return m_xMetaData.is() ? m_xMetaData : (m_xMetaData = new OResultSetMetaData(m_aStatementHandle));
+ return m_xMetaData.is() ? m_xMetaData : (m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle));
}
// -------------------------------------------------------------------------
Reference< XArray > SAL_CALL ODatabaseMetaDataResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
@@ -462,7 +469,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
sal_Int16 nVal = 0;
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_SHORT,m_bWasNull,**this,&nVal,sizeof nVal);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_SHORT,m_bWasNull,**this,&nVal,sizeof nVal);
if(m_aValueRange.size() && (m_aValueRangeIter = m_aValueRange.find(columnIndex)) != m_aValueRange.end())
return sal_Int16((*m_aValueRangeIter).second[(sal_Int32)nVal]);
@@ -478,7 +485,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
- ::rtl::OUString aVal = OTools::getStringValue(m_aStatementHandle,(SQLUSMALLINT)columnIndex,getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
+ ::rtl::OUString aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,(SWORD)getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
return aVal;
}
@@ -495,7 +502,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
TIME_STRUCT aTime={0,0,0};
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
return Time(0,aTime.second,aTime.minute,aTime.hour);
}
// -------------------------------------------------------------------------
@@ -510,7 +517,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
TIMESTAMP_STRUCT aTime={0,0,0,0,0,0,0};
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
return DateTime(aTime.fraction*1000,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
}
// -------------------------------------------------------------------------
@@ -590,7 +597,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first( ) throw(SQLException, Runt
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_FIRST,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet;
if(bRet = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO))
m_nRowPos = 1;
@@ -605,7 +612,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last( ) throw(SQLException, Runti
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_LAST,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
// here I know definitely that I stand on the last record
return m_bLastRecord = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO);
}
@@ -618,7 +625,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 row ) throw(SQ
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_ABSOLUTE,row);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
if(bRet)
m_nRowPos = row;
@@ -633,7 +640,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 row ) throw(SQ
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,row);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
if(bRet)
m_nRowPos += row;
@@ -648,7 +655,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous( ) throw(SQLException, R
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
if(bRet)
--m_nRowPos;
@@ -711,7 +718,7 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::next( ) throw(SQLException, Runti
// m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_NEXT,0);
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
}
// -------------------------------------------------------------------------
@@ -742,7 +749,7 @@ void SAL_CALL ODatabaseMetaDataResultSet::cancel( ) throw(RuntimeException)
::osl::MutexGuard aGuard( m_aMutex );
- OTools::ThrowException(N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void SAL_CALL ODatabaseMetaDataResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
@@ -915,7 +922,7 @@ void ODatabaseMetaDataResultSet::openTypeInfo() throw(SQLException, RuntimeExcep
m_aValueRange[2] = aMap;
- OTools::ThrowException(N3SQLGetTypeInfo(m_aStatementHandle, SQL_ALL_TYPES),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,N3SQLGetTypeInfo(m_aStatementHandle, SQL_ALL_TYPES),m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
//-----------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const ::rtl::OUString& schemaPattern,
@@ -956,7 +963,7 @@ void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const ::rtl::OUS
(SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS,
(SDB_ODBC_CHAR *) pCOL, pCOL ? SQL_NTS : 0);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
//-----------------------------------------------------------------------------
@@ -968,12 +975,12 @@ void ODatabaseMetaDataResultSet::openTablesTypes( ) throw(SQLException, RuntimeE
0,0,
0,0,
(SDB_ODBC_CHAR *) SQL_ALL_TABLE_TYPES,SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
m_aColMapping.clear();
m_aColMapping.push_back(-1);
m_aColMapping.push_back(4);
- m_xMetaData = new OResultSetMetaData(m_aStatementHandle,m_aColMapping);
+ m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle,m_aColMapping);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openCatalogs() throw(SQLException, RuntimeException)
@@ -985,12 +992,12 @@ void ODatabaseMetaDataResultSet::openCatalogs() throw(SQLException, RuntimeExcep
0,0,
(SDB_ODBC_CHAR *) "",SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
m_aColMapping.clear();
m_aColMapping.push_back(-1);
m_aColMapping.push_back(1);
- m_xMetaData = new OResultSetMetaData(m_aStatementHandle,m_aColMapping);
+ m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle,m_aColMapping);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openSchemas() throw(SQLException, RuntimeException)
@@ -1001,12 +1008,12 @@ void ODatabaseMetaDataResultSet::openSchemas() throw(SQLException, RuntimeExcept
(SDB_ODBC_CHAR *) SQL_ALL_SCHEMAS,SQL_NTS,
0,0,
(SDB_ODBC_CHAR *) "",SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
m_aColMapping.clear();
m_aColMapping.push_back(-1);
m_aColMapping.push_back(2);
- m_xMetaData = new OResultSetMetaData(m_aStatementHandle,m_aColMapping);
+ m_xMetaData = new OResultSetMetaData(m_pConnection,m_aStatementHandle,m_aColMapping);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, const ::rtl::OUString& schema,
@@ -1037,7 +1044,7 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, cons
(SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS,
(SDB_ODBC_CHAR *) pCOL, SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
@@ -1070,7 +1077,7 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS,
(SDB_ODBC_CHAR *) pCOL, SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
TInt2IntMap aMap;
aMap[SQL_BIT] = DataType::BIT;
aMap[SQL_TINYINT] = DataType::TINYINT;
@@ -1133,7 +1140,7 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS,
(SDB_ODBC_CHAR *) pCOL, SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const ::rtl::OUString& schemaPattern,
@@ -1162,7 +1169,7 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const ::rtl:
(SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
(SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openSpecialColumns(sal_Bool _bRowVer,const Any& catalog, const ::rtl::OUString& schema,
@@ -1190,9 +1197,9 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(sal_Bool _bRowVer,const Any&
(SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
(SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS,
- scope,
+ (SQLSMALLINT)scope,
nullable ? SQL_NULLABLE : SQL_NO_NULLS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openVersionColumns(const Any& catalog, const ::rtl::OUString& schema,
@@ -1234,7 +1241,7 @@ void ODatabaseMetaDataResultSet::openForeignKeys( const Any& catalog, const ::rt
(SDB_ODBC_CHAR *) pFKO, pFKO ? SQL_NTS : 0,
(SDB_ODBC_CHAR *) pFKN, SQL_NTS
);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openImportedKeys(const Any& catalog, const ::rtl::OUString& schema,
@@ -1275,7 +1282,7 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const ::rtl
(SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
(SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const ::rtl::OUString& schemaPattern,
@@ -1303,7 +1310,7 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const :
(SDB_ODBC_CHAR *) pPKQ, (catalog.hasValue() && aPKQ.getLength()) ? SQL_NTS : 0,
(SDB_ODBC_CHAR *) pPKO, pPKO ? SQL_NTS : 0 ,
(SDB_ODBC_CHAR *) pPKN, SQL_NTS);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const ::rtl::OUString& schema,
@@ -1334,7 +1341,7 @@ void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const ::rtl:
(SDB_ODBC_CHAR *) pPKN, SQL_NTS,
unique ? SQL_INDEX_UNIQUE : SQL_INDEX_ALL,
approximate);
- OTools::ThrowException(nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nRetcode,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbc/ODriver.cxx b/connectivity/source/drivers/odbc/ODriver.cxx
index 1e44a3043cec..94649de3f2d2 100644
--- a/connectivity/source/drivers/odbc/ODriver.cxx
+++ b/connectivity/source/drivers/odbc/ODriver.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODriver.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:11 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,7 @@
#ifndef _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_
#include "odbc/OFunctions.hxx"
#endif
+#include "odbc/OTools.hxx"
using namespace connectivity::odbc;
using namespace com::sun::star::uno;
@@ -137,11 +138,6 @@ SS SAL_CALL ODBCDriver::getSupportedServiceNames( ) throw(RuntimeException)
return getSupportedServiceNames_Static();
}
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::odbc::ODBCDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new ODBCDriver());
-}
// --------------------------------------------------------------------------------
Reference< XConnection > SAL_CALL ODBCDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
{
@@ -181,26 +177,5 @@ sal_Int32 SAL_CALL ODBCDriver::getMinorVersion( ) throw(RuntimeException)
}
// --------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-// ODBC Environment (gemeinsam fuer alle Connections):
-SQLHANDLE ODBCDriver::EnvironmentHandle(::rtl::OUString &_rPath)
-{
- // Ist (fuer diese Instanz) bereits ein Environment erzeugt worden?
- if (!m_pDriverHandle)
- {
- SQLHANDLE h = SQL_NULL_HANDLE;
- // Environment allozieren
-
- // ODBC-DLL jetzt laden:
- if (!LoadLibrary_ODBC3(_rPath) || N3SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&h) != SQL_SUCCESS)
- return SQL_NULL_HANDLE;
-
- // In globaler Struktur merken ...
- m_pDriverHandle = h;
- SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_UINTEGER);
- //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);
- }
-
- return m_pDriverHandle;
-}
diff --git a/connectivity/source/drivers/odbc/OFunctions.cxx b/connectivity/source/drivers/odbc/OFunctions.cxx
index 38cde70951bf..6367dfb0b1f2 100644
--- a/connectivity/source/drivers/odbc/OFunctions.cxx
+++ b/connectivity/source/drivers/odbc/OFunctions.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OFunctions.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:11 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,46 +69,75 @@
// Implib-Definitionen fuer ODBC-DLL/shared library:
-using namespace connectivity;
-
-// -------------------------------------------------------------------------
-sal_Bool connectivity::LoadLibrary_ADABAS(::rtl::OUString &_rPath)
+namespace connectivity
{
- static sal_Bool bLoaded = sal_False;
- static oslModule pODBCso = NULL;
-
- if (bLoaded)
- return sal_True;
-
- rtl_uString* pPath = NULL;
- ::rtl::OUString sTemp = ::rtl::OUString::createFromAscii("DBROOT");
- if(osl_getEnvironment(sTemp.pData,&pPath) == osl_Process_E_None && pPath)
- {
-
-#if ( defined(SOLARIS) && defined(SPARC)) || defined(LINUX)
- _rPath = ::rtl::OUString::createFromAscii(pPath);
- _rPath += ::rtl::OUString::createFromAscii("/lib/");
-#endif
- }
-#if defined(WIN) || defined(WNT)
- _rPath += ::rtl::OUString::createFromAscii("SQLOD32.DLL");
-#elif ( defined(SOLARIS) && defined(SPARC)) || defined(LINUX)
- _rPath += ::rtl::OUString::createFromAscii("odbclib.so");
-#else
- return sal_False;
-#endif
+ T3SQLAllocHandle pODBC3SQLAllocHandle;
+T3SQLConnect pODBC3SQLConnect;
+T3SQLDriverConnect pODBC3SQLDriverConnect;
+T3SQLBrowseConnect pODBC3SQLBrowseConnect;
+T3SQLDataSources pODBC3SQLDataSources;
+T3SQLDrivers pODBC3SQLDrivers;
+T3SQLGetInfo pODBC3SQLGetInfo;
+T3SQLGetFunctions pODBC3SQLGetFunctions;
+T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
+T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
+T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
+T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
+T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
+T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
+T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
+//T3SQLSetDescField pODBC3SQLSetDescField;
+//T3SQLGetDescField pODBC3SQLGetDescField;
+//T3SQLGetDescRec pODBC3SQLGetDescRec;
+//T3SQLSetDescRec pODBC3SQLSetDescRec;
+T3SQLPrepare pODBC3SQLPrepare;
+T3SQLBindParameter pODBC3SQLBindParameter;
+//T3SQLGetCursorName pODBC3SQLGetCursorName;
+T3SQLSetCursorName pODBC3SQLSetCursorName;
+T3SQLExecute pODBC3SQLExecute;
+T3SQLExecDirect pODBC3SQLExecDirect;
+//T3SQLNativeSql pODBC3SQLNativeSql;
+T3SQLDescribeParam pODBC3SQLDescribeParam;
+T3SQLNumParams pODBC3SQLNumParams;
+T3SQLParamData pODBC3SQLParamData;
+T3SQLPutData pODBC3SQLPutData;
+T3SQLRowCount pODBC3SQLRowCount;
+T3SQLNumResultCols pODBC3SQLNumResultCols;
+T3SQLDescribeCol pODBC3SQLDescribeCol;
+T3SQLColAttribute pODBC3SQLColAttribute;
+T3SQLBindCol pODBC3SQLBindCol;
+T3SQLFetch pODBC3SQLFetch;
+T3SQLFetchScroll pODBC3SQLFetchScroll;
+T3SQLGetData pODBC3SQLGetData;
+T3SQLSetPos pODBC3SQLSetPos;
+T3SQLBulkOperations pODBC3SQLBulkOperations;
+T3SQLMoreResults pODBC3SQLMoreResults;
+//T3SQLGetDiagField pODBC3SQLGetDiagField;
+T3SQLGetDiagRec pODBC3SQLGetDiagRec;
+T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
+T3SQLColumns pODBC3SQLColumns;
+T3SQLForeignKeys pODBC3SQLForeignKeys;
+T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
+T3SQLProcedureColumns pODBC3SQLProcedureColumns;
+T3SQLProcedures pODBC3SQLProcedures;
+T3SQLSpecialColumns pODBC3SQLSpecialColumns;
+T3SQLStatistics pODBC3SQLStatistics;
+T3SQLTablePrivileges pODBC3SQLTablePrivileges;
+T3SQLTables pODBC3SQLTables;
+T3SQLFreeStmt pODBC3SQLFreeStmt;
+T3SQLCloseCursor pODBC3SQLCloseCursor;
+T3SQLCancel pODBC3SQLCancel;
+T3SQLEndTran pODBC3SQLEndTran;
+T3SQLDisconnect pODBC3SQLDisconnect;
+T3SQLFreeHandle pODBC3SQLFreeHandle;
+T3SQLGetCursorName pODBC3SQLGetCursorName;
+T3SQLNativeSql pODBC3SQLNativeSql;
- pODBCso = osl_loadModule( _rPath.pData,SAL_LOADMODULE_NOW );
- if( !pODBCso)
- return sal_False;
-
-
- return bLoaded = LoadFunctions(pODBCso,sal_False);
-}
+sal_Bool LoadFunctions(oslModule pODBCso);
// -------------------------------------------------------------------------
// Dynamisches Laden der DLL/shared lib und Adressen der Funktionen besorgen:
// Liefert sal_True bei Erfolg.
-sal_Bool connectivity::LoadLibrary_ODBC3(::rtl::OUString &_rPath)
+sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath)
{
static sal_Bool bLoaded = sal_False;
static oslModule pODBCso = NULL;
@@ -143,200 +172,141 @@ sal_Bool connectivity::LoadLibrary_ODBC3(::rtl::OUString &_rPath)
return sal_False;
#endif
- return bLoaded = connectivity::LoadFunctions(pODBCso);
+ return bLoaded = LoadFunctions(pODBCso);
}
// -------------------------------------------------------------------------
-sal_Bool connectivity::LoadFunctions(oslModule pODBCso, sal_Bool _bDS)
+sal_Bool LoadFunctions(oslModule pODBCso)
{
- if( ( connectivity::pODBC3SQLAllocHandle = (T3SQLAllocHandle)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLAllocHandle").pData )) == NULL )
+ if( ( pODBC3SQLAllocHandle = (T3SQLAllocHandle)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLAllocHandle").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLConnect = (T3SQLConnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLConnect").pData )) == NULL )
+ if( ( pODBC3SQLConnect = (T3SQLConnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLConnect").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLDriverConnect = (T3SQLDriverConnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDriverConnect").pData )) == NULL )
+ if( ( pODBC3SQLDriverConnect = (T3SQLDriverConnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDriverConnect").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLBrowseConnect = (T3SQLBrowseConnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBrowseConnect").pData )) == NULL )
+ if( ( pODBC3SQLBrowseConnect = (T3SQLBrowseConnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBrowseConnect").pData )) == NULL )
return sal_False;
- if(_bDS && ( connectivity::pODBC3SQLDataSources = (T3SQLDataSources)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDataSources").pData )) == NULL )
+ if(( pODBC3SQLDataSources = (T3SQLDataSources)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDataSources").pData )) == NULL )
return sal_False;
- if(_bDS && ( connectivity::pODBC3SQLDrivers = (T3SQLDrivers)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDrivers").pData )) == NULL )
+ if(( pODBC3SQLDrivers = (T3SQLDrivers)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDrivers").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetInfo = (T3SQLGetInfo)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetInfo").pData )) == NULL )
+ if( ( pODBC3SQLGetInfo = (T3SQLGetInfo)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetInfo").pData )) == NULL )
return sal_False;
- if(_bDS && ( connectivity::pODBC3SQLGetFunctions = (T3SQLGetFunctions)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetFunctions").pData )) == NULL )
+ if(( pODBC3SQLGetFunctions = (T3SQLGetFunctions)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetFunctions").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetTypeInfo = (T3SQLGetTypeInfo)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetTypeInfo").pData )) == NULL )
+ if( ( pODBC3SQLGetTypeInfo = (T3SQLGetTypeInfo)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetTypeInfo").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLSetConnectAttr = (T3SQLSetConnectAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetConnectAttr").pData )) == NULL )
+ if( ( pODBC3SQLSetConnectAttr = (T3SQLSetConnectAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetConnectAttr").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetConnectAttr = (T3SQLGetConnectAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetConnectAttr").pData )) == NULL )
+ if( ( pODBC3SQLGetConnectAttr = (T3SQLGetConnectAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetConnectAttr").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLSetEnvAttr = (T3SQLSetEnvAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetEnvAttr").pData )) == NULL )
+ if( ( pODBC3SQLSetEnvAttr = (T3SQLSetEnvAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetEnvAttr").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetEnvAttr = (T3SQLGetEnvAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetEnvAttr").pData )) == NULL )
+ if( ( pODBC3SQLGetEnvAttr = (T3SQLGetEnvAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetEnvAttr").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLSetStmtAttr = (T3SQLSetStmtAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetStmtAttr").pData )) == NULL )
+ if( ( pODBC3SQLSetStmtAttr = (T3SQLSetStmtAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetStmtAttr").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetStmtAttr = (T3SQLGetStmtAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetStmtAttr").pData )) == NULL )
+ if( ( pODBC3SQLGetStmtAttr = (T3SQLGetStmtAttr)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetStmtAttr").pData )) == NULL )
return sal_False;
- /*if( ( connectivity::pODBC3SQLSetDescField = (T3SQLSetDescField)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetDescField").pData )) == NULL )
+ /*if( ( pODBC3SQLSetDescField = (T3SQLSetDescField)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetDescField").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetDescField = (T3SQLGetDescField)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDescField").pData )) == NULL )
+ if( ( pODBC3SQLGetDescField = (T3SQLGetDescField)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDescField").pData )) == NULL )
return sal_False;*/
- /*if( ( connectivity::pODBC3SQLGetDescRec = (T3SQLGetDescRec)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDescRec").pData )) == NULL )
+ /*if( ( pODBC3SQLGetDescRec = (T3SQLGetDescRec)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDescRec").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLSetDescRec = (T3SQLSetDescRec)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetDescRec").pData )) == NULL )
+ if( ( pODBC3SQLSetDescRec = (T3SQLSetDescRec)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetDescRec").pData )) == NULL )
return sal_False;*/
- if( ( connectivity::pODBC3SQLPrepare = (T3SQLPrepare)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLPrepare").pData )) == NULL )
+ if( ( pODBC3SQLPrepare = (T3SQLPrepare)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLPrepare").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLBindParameter = (T3SQLBindParameter)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBindParameter").pData )) == NULL )
+ if( ( pODBC3SQLBindParameter = (T3SQLBindParameter)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBindParameter").pData )) == NULL )
return sal_False;
-// if( ( connectivity::pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetCursorName").pData )) == NULL )
+// if( ( pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetCursorName").pData )) == NULL )
// return sal_False;
- if( ( connectivity::pODBC3SQLSetCursorName = (T3SQLSetCursorName)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetCursorName").pData )) == NULL )
+ if( ( pODBC3SQLSetCursorName = (T3SQLSetCursorName)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetCursorName").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLExecute = (T3SQLExecute)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLExecute").pData )) == NULL )
+ if( ( pODBC3SQLExecute = (T3SQLExecute)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLExecute").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLExecDirect = (T3SQLExecDirect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLExecDirect").pData )) == NULL )
+ if( ( pODBC3SQLExecDirect = (T3SQLExecDirect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLExecDirect").pData )) == NULL )
return sal_False;
- /*if( ( connectivity::pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNativeSql").pData )) == NULL )
+ /*if( ( pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNativeSql").pData )) == NULL )
return sal_False;*/
- if( ( connectivity::pODBC3SQLDescribeParam = (T3SQLDescribeParam)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDescribeParam").pData )) == NULL )
+ if( ( pODBC3SQLDescribeParam = (T3SQLDescribeParam)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDescribeParam").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLNumParams = (T3SQLNumParams)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNumParams").pData )) == NULL )
+ if( ( pODBC3SQLNumParams = (T3SQLNumParams)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNumParams").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLParamData = (T3SQLParamData)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLParamData").pData )) == NULL )
+ if( ( pODBC3SQLParamData = (T3SQLParamData)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLParamData").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLPutData = (T3SQLPutData)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLPutData").pData )) == NULL )
+ if( ( pODBC3SQLPutData = (T3SQLPutData)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLPutData").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLRowCount = (T3SQLRowCount)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLRowCount").pData )) == NULL )
+ if( ( pODBC3SQLRowCount = (T3SQLRowCount)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLRowCount").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLNumResultCols = (T3SQLNumResultCols)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNumResultCols").pData )) == NULL )
+ if( ( pODBC3SQLNumResultCols = (T3SQLNumResultCols)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNumResultCols").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLDescribeCol = (T3SQLDescribeCol)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDescribeCol").pData )) == NULL )
+ if( ( pODBC3SQLDescribeCol = (T3SQLDescribeCol)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDescribeCol").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLColAttribute = (T3SQLColAttribute)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLColAttribute").pData )) == NULL )
+ if( ( pODBC3SQLColAttribute = (T3SQLColAttribute)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLColAttribute").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLBindCol = (T3SQLBindCol)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBindCol").pData )) == NULL )
+ if( ( pODBC3SQLBindCol = (T3SQLBindCol)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBindCol").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLFetch = (T3SQLFetch)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFetch").pData )) == NULL )
+ if( ( pODBC3SQLFetch = (T3SQLFetch)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFetch").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLFetchScroll = (T3SQLFetchScroll)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFetchScroll").pData )) == NULL )
+ if( ( pODBC3SQLFetchScroll = (T3SQLFetchScroll)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFetchScroll").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetData = (T3SQLGetData)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetData").pData )) == NULL )
+ if( ( pODBC3SQLGetData = (T3SQLGetData)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetData").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLSetPos = (T3SQLSetPos)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetPos").pData )) == NULL )
+ if( ( pODBC3SQLSetPos = (T3SQLSetPos)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSetPos").pData )) == NULL )
return sal_False;
- if( _bDS && ( connectivity::pODBC3SQLBulkOperations = (T3SQLBulkOperations)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBulkOperations").pData )) == NULL )
+ if( ( pODBC3SQLBulkOperations = (T3SQLBulkOperations)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLBulkOperations").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLMoreResults = (T3SQLMoreResults)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLMoreResults").pData )) == NULL )
+ if( ( pODBC3SQLMoreResults = (T3SQLMoreResults)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLMoreResults").pData )) == NULL )
return sal_False;
- /*if( ( connectivity::pODBC3SQLGetDiagField = (T3SQLGetDiagField)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDiagField").pData )) == NULL )
+ /*if( ( pODBC3SQLGetDiagField = (T3SQLGetDiagField)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDiagField").pData )) == NULL )
return sal_False;*/
- if( ( connectivity::pODBC3SQLGetDiagRec = (T3SQLGetDiagRec)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDiagRec").pData )) == NULL )
+ if( ( pODBC3SQLGetDiagRec = (T3SQLGetDiagRec)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetDiagRec").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLColumnPrivileges = (T3SQLColumnPrivileges)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLColumnPrivileges").pData )) == NULL )
+ if( ( pODBC3SQLColumnPrivileges = (T3SQLColumnPrivileges)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLColumnPrivileges").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLColumns = (T3SQLColumns)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLColumns").pData )) == NULL )
+ if( ( pODBC3SQLColumns = (T3SQLColumns)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLColumns").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLForeignKeys = (T3SQLForeignKeys)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLForeignKeys").pData )) == NULL )
+ if( ( pODBC3SQLForeignKeys = (T3SQLForeignKeys)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLForeignKeys").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLPrimaryKeys = (T3SQLPrimaryKeys)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLPrimaryKeys").pData )) == NULL )
+ if( ( pODBC3SQLPrimaryKeys = (T3SQLPrimaryKeys)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLPrimaryKeys").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLProcedureColumns = (T3SQLProcedureColumns)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLProcedureColumns").pData )) == NULL )
+ if( ( pODBC3SQLProcedureColumns = (T3SQLProcedureColumns)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLProcedureColumns").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLProcedures = (T3SQLProcedures)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLProcedures").pData )) == NULL )
+ if( ( pODBC3SQLProcedures = (T3SQLProcedures)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLProcedures").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLSpecialColumns = (T3SQLSpecialColumns)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSpecialColumns").pData )) == NULL )
+ if( ( pODBC3SQLSpecialColumns = (T3SQLSpecialColumns)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLSpecialColumns").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLStatistics = (T3SQLStatistics)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLStatistics").pData )) == NULL )
+ if( ( pODBC3SQLStatistics = (T3SQLStatistics)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLStatistics").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLTablePrivileges = (T3SQLTablePrivileges)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLTablePrivileges").pData )) == NULL )
+ if( ( pODBC3SQLTablePrivileges = (T3SQLTablePrivileges)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLTablePrivileges").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLTables = (T3SQLTables)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLTables").pData )) == NULL )
+ if( ( pODBC3SQLTables = (T3SQLTables)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLTables").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLFreeStmt = (T3SQLFreeStmt)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFreeStmt").pData )) == NULL )
+ if( ( pODBC3SQLFreeStmt = (T3SQLFreeStmt)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFreeStmt").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLCloseCursor = (T3SQLCloseCursor)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLCloseCursor").pData )) == NULL )
+ if( ( pODBC3SQLCloseCursor = (T3SQLCloseCursor)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLCloseCursor").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLCancel = (T3SQLCancel)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLCancel").pData )) == NULL )
+ if( ( pODBC3SQLCancel = (T3SQLCancel)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLCancel").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLEndTran = (T3SQLEndTran)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLEndTran").pData )) == NULL )
+ if( ( pODBC3SQLEndTran = (T3SQLEndTran)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLEndTran").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLDisconnect = (T3SQLDisconnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDisconnect").pData )) == NULL )
+ if( ( pODBC3SQLDisconnect = (T3SQLDisconnect)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLDisconnect").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLFreeHandle = (T3SQLFreeHandle)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFreeHandle").pData )) == NULL )
+ if( ( pODBC3SQLFreeHandle = (T3SQLFreeHandle)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLFreeHandle").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetCursorName").pData )) == NULL )
+ if( ( pODBC3SQLGetCursorName = (T3SQLGetCursorName)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLGetCursorName").pData )) == NULL )
return sal_False;
- if( ( connectivity::pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNativeSql").pData )) == NULL )
+ if( ( pODBC3SQLNativeSql = (T3SQLNativeSql)osl_getSymbol(pODBCso, ::rtl::OUString::createFromAscii("SQLNativeSql").pData )) == NULL )
return sal_False;
return sal_True;
}
// -------------------------------------------------------------------------
-connectivity::T3SQLAllocHandle connectivity::pODBC3SQLAllocHandle;
-connectivity::T3SQLConnect connectivity::pODBC3SQLConnect;
-connectivity::T3SQLDriverConnect connectivity::pODBC3SQLDriverConnect;
-connectivity::T3SQLBrowseConnect connectivity::pODBC3SQLBrowseConnect;
-connectivity::T3SQLDataSources connectivity::pODBC3SQLDataSources;
-connectivity::T3SQLDrivers connectivity::pODBC3SQLDrivers;
-connectivity::T3SQLGetInfo connectivity::pODBC3SQLGetInfo;
-connectivity::T3SQLGetFunctions connectivity::pODBC3SQLGetFunctions;
-connectivity::T3SQLGetTypeInfo connectivity::pODBC3SQLGetTypeInfo;
-connectivity::T3SQLSetConnectAttr connectivity::pODBC3SQLSetConnectAttr;
-connectivity::T3SQLGetConnectAttr connectivity::pODBC3SQLGetConnectAttr;
-connectivity::T3SQLSetEnvAttr connectivity::pODBC3SQLSetEnvAttr;
-connectivity::T3SQLGetEnvAttr connectivity::pODBC3SQLGetEnvAttr;
-connectivity::T3SQLSetStmtAttr connectivity::pODBC3SQLSetStmtAttr;
-connectivity::T3SQLGetStmtAttr connectivity::pODBC3SQLGetStmtAttr;
-//connectivity::T3SQLSetDescField connectivity::pODBC3SQLSetDescField;
-//connectivity::T3SQLGetDescField connectivity::pODBC3SQLGetDescField;
-//connectivity::T3SQLGetDescRec connectivity::pODBC3SQLGetDescRec;
-//connectivity::T3SQLSetDescRec connectivity::pODBC3SQLSetDescRec;
-connectivity::T3SQLPrepare connectivity::pODBC3SQLPrepare;
-connectivity::T3SQLBindParameter connectivity::pODBC3SQLBindParameter;
-//connectivity::T3SQLGetCursorName connectivity::pODBC3SQLGetCursorName;
-connectivity::T3SQLSetCursorName connectivity::pODBC3SQLSetCursorName;
-connectivity::T3SQLExecute connectivity::pODBC3SQLExecute;
-connectivity::T3SQLExecDirect connectivity::pODBC3SQLExecDirect;
-//connectivity::T3SQLNativeSql connectivity::pODBC3SQLNativeSql;
-connectivity::T3SQLDescribeParam connectivity::pODBC3SQLDescribeParam;
-connectivity::T3SQLNumParams connectivity::pODBC3SQLNumParams;
-connectivity::T3SQLParamData connectivity::pODBC3SQLParamData;
-connectivity::T3SQLPutData connectivity::pODBC3SQLPutData;
-connectivity::T3SQLRowCount connectivity::pODBC3SQLRowCount;
-connectivity::T3SQLNumResultCols connectivity::pODBC3SQLNumResultCols;
-connectivity::T3SQLDescribeCol connectivity::pODBC3SQLDescribeCol;
-connectivity::T3SQLColAttribute connectivity::pODBC3SQLColAttribute;
-connectivity::T3SQLBindCol connectivity::pODBC3SQLBindCol;
-connectivity::T3SQLFetch connectivity::pODBC3SQLFetch;
-connectivity::T3SQLFetchScroll connectivity::pODBC3SQLFetchScroll;
-connectivity::T3SQLGetData connectivity::pODBC3SQLGetData;
-connectivity::T3SQLSetPos connectivity::pODBC3SQLSetPos;
-connectivity::T3SQLBulkOperations connectivity::pODBC3SQLBulkOperations;
-connectivity::T3SQLMoreResults connectivity::pODBC3SQLMoreResults;
-//connectivity::T3SQLGetDiagField connectivity::pODBC3SQLGetDiagField;
-connectivity::T3SQLGetDiagRec connectivity::pODBC3SQLGetDiagRec;
-connectivity::T3SQLColumnPrivileges connectivity::pODBC3SQLColumnPrivileges;
-connectivity::T3SQLColumns connectivity::pODBC3SQLColumns;
-connectivity::T3SQLForeignKeys connectivity::pODBC3SQLForeignKeys;
-connectivity::T3SQLPrimaryKeys connectivity::pODBC3SQLPrimaryKeys;
-connectivity::T3SQLProcedureColumns connectivity::pODBC3SQLProcedureColumns;
-connectivity::T3SQLProcedures connectivity::pODBC3SQLProcedures;
-connectivity::T3SQLSpecialColumns connectivity::pODBC3SQLSpecialColumns;
-connectivity::T3SQLStatistics connectivity::pODBC3SQLStatistics;
-connectivity::T3SQLTablePrivileges connectivity::pODBC3SQLTablePrivileges;
-connectivity::T3SQLTables connectivity::pODBC3SQLTables;
-connectivity::T3SQLFreeStmt connectivity::pODBC3SQLFreeStmt;
-connectivity::T3SQLCloseCursor connectivity::pODBC3SQLCloseCursor;
-connectivity::T3SQLCancel connectivity::pODBC3SQLCancel;
-connectivity::T3SQLEndTran connectivity::pODBC3SQLEndTran;
-connectivity::T3SQLDisconnect connectivity::pODBC3SQLDisconnect;
-connectivity::T3SQLFreeHandle connectivity::pODBC3SQLFreeHandle;
-connectivity::T3SQLGetCursorName connectivity::pODBC3SQLGetCursorName;
-connectivity::T3SQLNativeSql connectivity::pODBC3SQLNativeSql;
+}
+
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 7b93ec76faa7..827328e36133 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OPreparedStatement.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:11 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -153,7 +153,7 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) thr
prepareStatement();
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(m_aStatementHandle);
+ m_xMetaData = new OResultSetMetaData(getOwnConnection(),m_aStatementHandle);
return m_xMetaData;
}
// -------------------------------------------------------------------------
@@ -208,7 +208,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc
{
SQLRETURN nReturn = N3SQLExecute(m_aStatementHandle);
- OTools::ThrowException(nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
needData = nReturn == SQL_NEED_DATA;
// Now loop while more data is needed (i.e. a data-at-
@@ -237,7 +237,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc
}
}
- catch (SQLWarning& ex)
+ catch (const SQLWarning&)
{
}
@@ -367,10 +367,12 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool
}
// -------------------------------------------------------------------------
#define PREP_BIND_PARAM(_ty,_jt) \
- OTools::bindParameter( m_aStatementHandle, \
+ OTools::bindParameter(m_pConnection, \
+ m_aStatementHandle, \
parameterIndex, \
- bindBuf,getLengthBuf(parameterIndex), \
- _jt, \
+ bindBuf, \
+ getLengthBuf(parameterIndex), \
+ (SWORD)_jt, \
sal_False,sal_False,&x,(Reference <XInterface>)*this,getOwnConnection()->getTextEncoding())
@@ -562,7 +564,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s
*(SDWORD*)lenBuf = SQL_NULL_DATA;
- UDWORD prec = 0;
+ SQLINTEGER prec = 0;
if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR)
prec = 1;
@@ -572,18 +574,18 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s
SQLSMALLINT nDecimalDigits = 0;
OTools::getBindTypes(sal_False,sal_False,sqlType,fCType,fSqlType,nColumnSize,nDecimalDigits);
- SQLRETURN nReturn = N3SQLBindParameter(m_aStatementHandle,
- parameterIndex,
- SQL_PARAM_INPUT,
- fCType,
- fSqlType,
- nDecimalDigits,
- nColumnSize,
- NULL,
- prec,
- (SDWORD*)lenBuf
- );
- OTools::ThrowException(nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ SQLRETURN nReturn = N3SQLBindParameter( m_aStatementHandle,
+ (SQLUSMALLINT)parameterIndex,
+ (SQLSMALLINT)SQL_PARAM_INPUT,
+ fCType,
+ fSqlType,
+ nColumnSize,
+ nDecimalDigits,
+ NULL,
+ prec,
+ (SDWORD*)lenBuf
+ );
+ OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
@@ -1083,7 +1085,7 @@ sal_Int32 OPreparedStatement::getPrecision ( sal_Int32 sqlType)
if (m_aTypeInfo.size())
{
OTypeInfo aInfo;
- aInfo.nType = sqlType;
+ aInfo.nType = (sal_Int16)sqlType;
TTypeInfoVector::const_iterator aIter = ::std::find(m_aTypeInfo.begin(),m_aTypeInfo.end(),aInfo);
if(aIter != m_aTypeInfo.end())
prec = (*aIter).nPrecision;
@@ -1097,12 +1099,12 @@ sal_Int32 OPreparedStatement::getPrecision ( sal_Int32 sqlType)
//--------------------------------------------------------------------
void OPreparedStatement::setStream (
- sal_Int32 ParameterIndex,
- const Reference< XInputStream>& x,
- sal_Int32 length,
- sal_Int32 SQLtype,
- sal_Int32 streamType)
- throw(SQLException)
+ sal_Int32 ParameterIndex,
+ const Reference< XInputStream>& x,
+ sal_Int32 length,
+ sal_Int32 SQLtype,
+ sal_Int32 streamType)
+ throw(SQLException)
{
if( !ParameterIndex || ParameterIndex > numParams)
::dbtools::throwInvalidIndexException(*this);
@@ -1117,7 +1119,7 @@ void OPreparedStatement::setStream (
sal_Int8* dataBuf = allocBindBuf (ParameterIndex, 4);
// Bind the parameter with SQL_LEN_DATA_AT_EXEC
- SWORD Ctype = SQL_C_CHAR;
+ SQLSMALLINT Ctype = SQL_C_CHAR;
SDWORD atExec = SQL_LEN_DATA_AT_EXEC (length);
memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex));
memcpy (lenBuf, &atExec, sizeof (atExec));
@@ -1127,8 +1129,16 @@ void OPreparedStatement::setStream (
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- N3SQLBindParameter(m_aStatementHandle, (SQLUSMALLINT)ParameterIndex,SQL_PARAM_INPUT,Ctype,
- SQLtype, length,0, dataBuf, sizeof(ParameterIndex),(SDWORD*)lenBuf);
+ N3SQLBindParameter(m_aStatementHandle,
+ (SQLUSMALLINT)ParameterIndex,
+ (SQLSMALLINT)SQL_PARAM_INPUT,
+ Ctype,
+ (SQLSMALLINT)SQLtype,
+ (SQLUINTEGER)length,
+ 0,
+ dataBuf,
+ sizeof(ParameterIndex),
+ (SDWORD*)lenBuf);
// Save the input stream
@@ -1202,11 +1212,15 @@ void OPreparedStatement::setBinary (sal_Int32 parameterIndex,sal_Int32 SQLtype,
// Get the buffer needed for the length
// sal_Int8* lenBuf = getLengthBuf (parameterIndex);
- OTools::bindParameter( m_aStatementHandle,
- parameterIndex,
- bindBuf,getLengthBuf(parameterIndex),
- SQLtype,
- sal_False,sal_False,&x,(Reference <XInterface>)*this,getOwnConnection()->getTextEncoding());
+ OTools::bindParameter( m_pConnection,
+ m_aStatementHandle,
+ (SQLUSMALLINT)parameterIndex,
+ bindBuf,getLengthBuf(parameterIndex),
+ (SQLSMALLINT)SQLtype,
+ sal_False,
+ sal_False,
+ &x,
+ (Reference <XInterface>)*this,getOwnConnection()->getTextEncoding());
// N3SQLBindInParameterBinary (m_aStatementHandle, parameterIndex,
@@ -1252,7 +1266,7 @@ void OPreparedStatement::prepareStatement()
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
::rtl::OString aSql(::rtl::OUStringToOString(m_sSqlStatement,getOwnConnection()->getTextEncoding()));
SQLRETURN nReturn = N3SQLPrepare(m_aStatementHandle,(SDB_ODBC_CHAR *) aSql.getStr(),aSql.getLength());
- OTools::ThrowException(nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
initBoundParam();
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbc/ORealDriver.cxx b/connectivity/source/drivers/odbc/ORealDriver.cxx
new file mode 100644
index 000000000000..9a19df645e09
--- /dev/null
+++ b/connectivity/source/drivers/odbc/ORealDriver.cxx
@@ -0,0 +1,404 @@
+/*************************************************************************
+ *
+ * $RCSfile: ORealDriver.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the License); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_ODBC_ODRIVER_HXX_
+#include "odbc/ODriver.hxx"
+#endif
+#ifndef _CONNECTIVITY_OTOOLS_HXX_
+#include "odbc/OTools.hxx"
+#endif
+#ifndef _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_
+#include "odbc/OFunctions.hxx"
+#endif
+
+namespace connectivity
+{
+ sal_Bool LoadFunctions(oslModule pODBCso);
+ sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath);
+ // extern declaration of the function pointer
+ extern T3SQLAllocHandle pODBC3SQLAllocHandle;
+ extern T3SQLConnect pODBC3SQLConnect;
+ extern T3SQLDriverConnect pODBC3SQLDriverConnect;
+ extern T3SQLBrowseConnect pODBC3SQLBrowseConnect;
+ extern T3SQLDataSources pODBC3SQLDataSources;
+ extern T3SQLDrivers pODBC3SQLDrivers;
+ extern T3SQLGetInfo pODBC3SQLGetInfo;
+ extern T3SQLGetFunctions pODBC3SQLGetFunctions;
+ extern T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
+ extern T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
+ extern T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
+ extern T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
+ extern T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
+ extern T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
+ extern T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
+ //extern T3SQLSetDescField pODBC3SQLSetDescField;
+ //extern T3SQLGetDescField pODBC3SQLGetDescField;
+ //extern T3SQLGetDescRec pODBC3SQLGetDescRec;
+ //extern T3SQLSetDescRec pODBC3SQLSetDescRec;
+ extern T3SQLPrepare pODBC3SQLPrepare;
+ extern T3SQLBindParameter pODBC3SQLBindParameter;
+ //extern T3SQLGetCursorName pODBC3SQLGetCursorName;
+ extern T3SQLSetCursorName pODBC3SQLSetCursorName;
+ extern T3SQLExecute pODBC3SQLExecute;
+ extern T3SQLExecDirect pODBC3SQLExecDirect;
+ //extern T3SQLNativeSql pODBC3SQLNativeSql;
+ extern T3SQLDescribeParam pODBC3SQLDescribeParam;
+ extern T3SQLNumParams pODBC3SQLNumParams;
+ extern T3SQLParamData pODBC3SQLParamData;
+ extern T3SQLPutData pODBC3SQLPutData;
+ extern T3SQLRowCount pODBC3SQLRowCount;
+ extern T3SQLNumResultCols pODBC3SQLNumResultCols;
+ extern T3SQLDescribeCol pODBC3SQLDescribeCol;
+ extern T3SQLColAttribute pODBC3SQLColAttribute;
+ extern T3SQLBindCol pODBC3SQLBindCol;
+ extern T3SQLFetch pODBC3SQLFetch;
+ extern T3SQLFetchScroll pODBC3SQLFetchScroll;
+ extern T3SQLGetData pODBC3SQLGetData;
+ extern T3SQLSetPos pODBC3SQLSetPos;
+ extern T3SQLBulkOperations pODBC3SQLBulkOperations;
+ extern T3SQLMoreResults pODBC3SQLMoreResults;
+ //extern T3SQLGetDiagField pODBC3SQLGetDiagField;
+ extern T3SQLGetDiagRec pODBC3SQLGetDiagRec;
+ extern T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
+ extern T3SQLColumns pODBC3SQLColumns;
+ extern T3SQLForeignKeys pODBC3SQLForeignKeys;
+ extern T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
+ extern T3SQLProcedureColumns pODBC3SQLProcedureColumns;
+ extern T3SQLProcedures pODBC3SQLProcedures;
+ extern T3SQLSpecialColumns pODBC3SQLSpecialColumns;
+ extern T3SQLStatistics pODBC3SQLStatistics;
+ extern T3SQLTablePrivileges pODBC3SQLTablePrivileges;
+ extern T3SQLTables pODBC3SQLTables;
+ extern T3SQLFreeStmt pODBC3SQLFreeStmt;
+ extern T3SQLCloseCursor pODBC3SQLCloseCursor;
+ extern T3SQLCancel pODBC3SQLCancel;
+ extern T3SQLEndTran pODBC3SQLEndTran;
+ extern T3SQLDisconnect pODBC3SQLDisconnect;
+ extern T3SQLFreeHandle pODBC3SQLFreeHandle;
+ extern T3SQLGetCursorName pODBC3SQLGetCursorName;
+ extern T3SQLNativeSql pODBC3SQLNativeSql;
+
+
+ namespace odbc
+ {
+ class ORealObdcDriver : public ODBCDriver
+ {
+ protected:
+ virtual void* getOdbcFunction(sal_Int32 _nIndex) const;
+ virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath);
+ public:
+ ORealObdcDriver(){}
+ };
+
+ //------------------------------------------------------------------
+void* ORealObdcDriver::getOdbcFunction(sal_Int32 _nIndex) const
+{
+ void* pFunction = NULL;
+ switch(_nIndex)
+ {
+ case ODBC3SQLAllocHandle:
+ pFunction = pODBC3SQLAllocHandle;;
+ break;
+ case ODBC3SQLConnect:
+ pFunction = pODBC3SQLConnect;
+ break;
+ case ODBC3SQLDriverConnect:
+ pFunction = pODBC3SQLDriverConnect;
+ break;
+ case ODBC3SQLBrowseConnect:
+ pFunction = pODBC3SQLBrowseConnect;
+ break;
+ case ODBC3SQLDataSources:
+ pFunction = pODBC3SQLDataSources;
+ break;
+ case ODBC3SQLDrivers:
+ pFunction = pODBC3SQLDrivers;
+ break;
+ case ODBC3SQLGetInfo:
+
+ pFunction = pODBC3SQLGetInfo;
+ break;
+ case ODBC3SQLGetFunctions:
+
+ pFunction = pODBC3SQLGetFunctions;
+ break;
+ case ODBC3SQLGetTypeInfo:
+
+ pFunction = pODBC3SQLGetTypeInfo;
+ break;
+ case ODBC3SQLSetConnectAttr:
+
+ pFunction = pODBC3SQLSetConnectAttr;
+ break;
+ case ODBC3SQLGetConnectAttr:
+
+ pFunction = pODBC3SQLGetConnectAttr;
+ break;
+ case ODBC3SQLSetEnvAttr:
+
+ pFunction = pODBC3SQLSetEnvAttr;
+ break;
+ case ODBC3SQLGetEnvAttr:
+
+ pFunction = pODBC3SQLGetEnvAttr;
+ break;
+ case ODBC3SQLSetStmtAttr:
+
+ pFunction = pODBC3SQLSetStmtAttr;
+ break;
+ case ODBC3SQLGetStmtAttr:
+
+ pFunction = pODBC3SQLGetStmtAttr;
+ break;
+ case ODBC3SQLPrepare:
+
+ pFunction = pODBC3SQLPrepare;
+ break;
+ case ODBC3SQLBindParameter:
+
+ pFunction = pODBC3SQLBindParameter;
+ break;
+ case ODBC3SQLSetCursorName:
+
+ pFunction = pODBC3SQLSetCursorName;
+ break;
+ case ODBC3SQLExecute:
+
+ pFunction = pODBC3SQLExecute;
+ break;
+ case ODBC3SQLExecDirect:
+
+ pFunction = pODBC3SQLExecDirect;
+ break;
+ case ODBC3SQLDescribeParam:
+
+ pFunction = pODBC3SQLDescribeParam;
+ break;
+ case ODBC3SQLNumParams:
+
+ pFunction = pODBC3SQLNumParams;
+ break;
+ case ODBC3SQLParamData:
+
+ pFunction = pODBC3SQLParamData;
+ break;
+ case ODBC3SQLPutData:
+
+ pFunction = pODBC3SQLPutData;
+ break;
+ case ODBC3SQLRowCount:
+
+ pFunction = pODBC3SQLRowCount;
+ break;
+ case ODBC3SQLNumResultCols:
+
+ pFunction = pODBC3SQLNumResultCols;
+ break;
+ case ODBC3SQLDescribeCol:
+
+ pFunction = pODBC3SQLDescribeCol;
+ break;
+ case ODBC3SQLColAttribute:
+
+ pFunction = pODBC3SQLColAttribute;
+ break;
+ case ODBC3SQLBindCol:
+
+ pFunction = pODBC3SQLBindCol;
+ break;
+ case ODBC3SQLFetch:
+
+ pFunction = pODBC3SQLFetch;
+ break;
+ case ODBC3SQLFetchScroll:
+
+ pFunction = pODBC3SQLFetchScroll;
+ break;
+ case ODBC3SQLGetData:
+
+ pFunction = pODBC3SQLGetData;
+ break;
+ case ODBC3SQLSetPos:
+
+ pFunction = pODBC3SQLSetPos;
+ break;
+ case ODBC3SQLBulkOperations:
+
+ pFunction = pODBC3SQLBulkOperations;
+ break;
+ case ODBC3SQLMoreResults:
+
+ pFunction = pODBC3SQLMoreResults;
+ break;
+ case ODBC3SQLGetDiagRec:
+
+ pFunction = pODBC3SQLGetDiagRec;
+ break;
+ case ODBC3SQLColumnPrivileges:
+
+ pFunction = pODBC3SQLColumnPrivileges;
+ break;
+ case ODBC3SQLColumns:
+
+ pFunction = pODBC3SQLColumns;
+ break;
+ case ODBC3SQLForeignKeys:
+
+ pFunction = pODBC3SQLForeignKeys;
+ break;
+ case ODBC3SQLPrimaryKeys:
+
+ pFunction = pODBC3SQLPrimaryKeys;
+ break;
+ case ODBC3SQLProcedureColumns:
+
+ pFunction = pODBC3SQLProcedureColumns;
+ break;
+ case ODBC3SQLProcedures:
+
+ pFunction = pODBC3SQLProcedures;
+ break;
+ case ODBC3SQLSpecialColumns:
+
+ pFunction = pODBC3SQLSpecialColumns;
+ break;
+ case ODBC3SQLStatistics:
+
+ pFunction = pODBC3SQLStatistics;
+ break;
+ case ODBC3SQLTablePrivileges:
+
+ pFunction = pODBC3SQLTablePrivileges;
+ break;
+ case ODBC3SQLTables:
+
+ pFunction = pODBC3SQLTables;
+ break;
+ case ODBC3SQLFreeStmt:
+
+ pFunction = pODBC3SQLFreeStmt;
+ break;
+ case ODBC3SQLCloseCursor:
+
+ pFunction = pODBC3SQLCloseCursor;
+ break;
+ case ODBC3SQLCancel:
+
+ pFunction = pODBC3SQLCancel;
+ break;
+ case ODBC3SQLEndTran:
+
+ pFunction = pODBC3SQLEndTran;
+ break;
+ case ODBC3SQLDisconnect:
+
+ pFunction = pODBC3SQLDisconnect;
+ break;
+ case ODBC3SQLFreeHandle:
+
+ pFunction = pODBC3SQLFreeHandle;
+ break;
+ case ODBC3SQLGetCursorName:
+
+ pFunction = pODBC3SQLGetCursorName;
+ break;
+ case ODBC3SQLNativeSql:
+
+ pFunction = pODBC3SQLNativeSql;
+ break;
+ default:
+ OSL_ENSURE(0,"Function unknown!");
+ }
+ return pFunction;
+}
+
+//------------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODBCDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
+{
+ return *(new ORealObdcDriver());
+}
+// -----------------------------------------------------------------------------
+// ODBC Environment (gemeinsam fuer alle Connections):
+SQLHANDLE ORealObdcDriver::EnvironmentHandle(::rtl::OUString &_rPath)
+{
+ // Ist (fuer diese Instanz) bereits ein Environment erzeugt worden?
+ if (!m_pDriverHandle)
+ {
+ SQLHANDLE h = SQL_NULL_HANDLE;
+ // Environment allozieren
+
+ // ODBC-DLL jetzt laden:
+ if (!LoadLibrary_ODBC3(_rPath) || N3SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&h) != SQL_SUCCESS)
+ return SQL_NULL_HANDLE;
+
+ // In globaler Struktur merken ...
+ m_pDriverHandle = h;
+ SQLRETURN nError = N3SQLSetEnvAttr(h, SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_UINTEGER);
+ //N3SQLSetEnvAttr(h, SQL_ATTR_CONNECTION_POOLING,(SQLPOINTER) SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);
+ }
+
+ return m_pDriverHandle;
+}
+// -----------------------------------------------------------------------------
+
+ }
+}
+
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index 06d16cf83c7e..4d8a55fec736 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OResultSet.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:50:18 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -146,6 +146,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
,m_bInserting(sal_False)
,m_nLastColumnPos(0)
,m_nTextEncoding(pStmt->getOwnConnection()->getTextEncoding())
+ ,m_pStatement(pStmt)
{
osl_incrementInterlockedCount( &m_refCount );
m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
@@ -160,25 +161,25 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
osl_decrementInterlockedCount( &m_refCount );
}
// -------------------------------------------------------------------------
-OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,rtl_TextEncoding _nTextEncoding) : OResultSet_BASE(m_aMutex)
- ,OPropertySetHelper(OResultSet_BASE::rBHelper)
- ,m_aStatement(NULL)
- ,m_aStatementHandle(_pStatementHandle)
- ,m_aConnectionHandle(NULL)
- ,m_nRowPos(0)
- ,m_bLastRecord(sal_False)
- ,m_bEOF(sal_False)
- ,m_bFreeHandle(sal_False)
- ,m_xMetaData(NULL)
- ,m_bInserting(sal_False)
- ,m_nLastColumnPos(0)
- ,m_nTextEncoding(_nTextEncoding)
-{
- osl_incrementInterlockedCount( &m_refCount );
- m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
- osl_decrementInterlockedCount( &m_refCount );
- // allocBuffer();
-}
+//OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,rtl_TextEncoding _nTextEncoding) : OResultSet_BASE(m_aMutex)
+// ,OPropertySetHelper(OResultSet_BASE::rBHelper)
+// ,m_aStatement(NULL)
+// ,m_aStatementHandle(_pStatementHandle)
+// ,m_aConnectionHandle(NULL)
+// ,m_nRowPos(0)
+// ,m_bLastRecord(sal_False)
+// ,m_bEOF(sal_False)
+// ,m_bFreeHandle(sal_False)
+// ,m_xMetaData(NULL)
+// ,m_bInserting(sal_False)
+// ,m_nLastColumnPos(0)
+// ,m_nTextEncoding(_nTextEncoding)
+//{
+// osl_incrementInterlockedCount( &m_refCount );
+// m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
+// osl_decrementInterlockedCount( &m_refCount );
+// // allocBuffer();
+//}
// -------------------------------------------------------------------------
OResultSet::~OResultSet()
@@ -378,7 +379,12 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) t
sal_Int32 nLen = xMeta->getColumnCount();
sal_Int32 i = 1;
for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
+ if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
+#if SUPD > 631
+ columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
+#else
+ columnName.equalsIgnoreCase(xMeta->getColumnName(i)))
+#endif
break;
return i;
}
@@ -423,7 +429,7 @@ sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLExcep
sal_Int8 nVal(0);
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_BIT,m_bWasNull,**this,&nVal,sizeof nVal);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_BIT,m_bWasNull,**this,&nVal,sizeof nVal);
return nVal;
}
// -------------------------------------------------------------------------
@@ -445,7 +451,7 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio
m_aRow[columnIndex] >>= nRet;
}
else
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_CHAR,m_bWasNull,**this,&nRet,sizeof nRet);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_CHAR,m_bWasNull,**this,&nRet,sizeof nRet);
return nRet;
}
// -------------------------------------------------------------------------
@@ -473,18 +479,18 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
return nRet;
}
- sal_Int32 nType = getMetaData()->getColumnType(columnIndex);
+ SWORD nType = getMetaData()->getColumnType(columnIndex);
switch(nType)
{
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
- ::rtl::OUString aRet = OTools::getStringValue(m_aStatementHandle,columnIndex,getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
+ ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
break;
}
- return OTools::getBytesValue(m_aStatementHandle,columnIndex,nType,m_bWasNull,**this);
+ return OTools::getBytesValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nType,m_bWasNull,**this);
}
// -------------------------------------------------------------------------
@@ -510,7 +516,7 @@ Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, R
aDate.day = 0;
aDate.month = 0;
aDate.year = 0;
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
nRet = Date(aDate.day,aDate.month,aDate.year);
}
return nRet;
@@ -534,7 +540,7 @@ double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLExceptio
}
else
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_DOUBLE,m_bWasNull,**this,&nRet,sizeof nRet);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_DOUBLE,m_bWasNull,**this,&nRet,sizeof nRet);
return nRet;
}
// -------------------------------------------------------------------------
@@ -547,7 +553,7 @@ float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException,
columnIndex = mapColumn(columnIndex);
float nVal(0);
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_FLOAT,m_bWasNull,**this,&nVal,sizeof nVal);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_FLOAT,m_bWasNull,**this,&nVal,sizeof nVal);
return nVal;
}
// -------------------------------------------------------------------------
@@ -567,7 +573,7 @@ sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLExceptio
m_aRow[columnIndex] >>= nRet;
}
else
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_LONG,m_bWasNull,**this,&nRet,sizeof nRet);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_LONG,m_bWasNull,**this,&nRet,sizeof nRet);
return nRet;
}
@@ -580,7 +586,7 @@ sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
sal_Int32 nValue = 0;
- OTools::ThrowException(N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_NUMBER,&nValue,SQL_IS_UINTEGER,0),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_NUMBER,&nValue,SQL_IS_UINTEGER,0),m_aStatementHandle,SQL_HANDLE_STMT,*this);
if(!nValue) // some driver dosen't support this
m_nRowPos = nValue;
return nValue;
@@ -605,7 +611,7 @@ Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLEx
if(!m_xMetaData.is())
- m_xMetaData = new OResultSetMetaData(m_aStatementHandle);
+ m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection(),m_aStatementHandle);
return m_xMetaData;
}
// -------------------------------------------------------------------------
@@ -681,7 +687,7 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
}
else
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_SHORT,m_bWasNull,**this,&nRet,sizeof nRet);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_SHORT,m_bWasNull,**this,&nRet,sizeof nRet);
return nRet;
}
// -------------------------------------------------------------------------
@@ -702,7 +708,7 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
m_aRow[columnIndex] >>= nRet;
}
else
- nRet = OTools::getStringValue(m_aStatementHandle,columnIndex,getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
+ nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,(SWORD)getMetaData()->getColumnType(columnIndex),m_bWasNull,**this,m_nTextEncoding);
return nRet;
}
// -------------------------------------------------------------------------
@@ -724,7 +730,7 @@ Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, R
else
{
TIME_STRUCT aTime={0,0,0};
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
nRet = Time(0,aTime.second,aTime.minute,aTime.hour);
}
return nRet;
@@ -752,7 +758,7 @@ DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLExc
else
{
TIMESTAMP_STRUCT aTime={0,0,0,0,0,0,0};
- OTools::getValue(m_aStatementHandle,columnIndex,SQL_C_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
+ OTools::getValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_C_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
nRet = DateTime(aTime.fraction*1000,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
}
return nRet;
@@ -838,7 +844,7 @@ sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
m_nLastColumnPos = 0;
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_FIRST,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet;
if(bRet = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO))
m_nRowPos = 1;
@@ -854,7 +860,7 @@ sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
m_nLastColumnPos = 0;
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_LAST,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
// here I know definitely that I stand on the last record
return m_bLastRecord = (m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO);
}
@@ -867,7 +873,7 @@ sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, Runt
m_nLastColumnPos = 0;
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_ABSOLUTE,row);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
if(bRet)
m_nRowPos = row;
@@ -882,7 +888,7 @@ sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, Runt
m_nLastColumnPos = 0;
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,row);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
if(bRet)
m_nRowPos += row;
@@ -897,7 +903,7 @@ sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
m_nLastColumnPos = 0;
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_PRIOR,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
sal_Bool bRet = m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
if(bRet || m_nCurrentFetchState == SQL_NO_DATA)
--m_nRowPos;
@@ -951,7 +957,7 @@ sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
m_nLastColumnPos = 0;
// m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_NEXT,0);
m_nCurrentFetchState = N3SQLFetch(m_aStatementHandle);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
if(m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO)
++m_nRowPos;
return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
@@ -974,7 +980,7 @@ void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- OTools::ThrowException(N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
@@ -993,7 +999,7 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
SQLRETURN nRet;
- if(pODBC3SQLBulkOperations)
+ if(getOdbcFunction(ODBC3SQLBulkOperations))
nRet = N3SQLBulkOperations(m_aStatementHandle, SQL_ADD);
else
{
@@ -1001,7 +1007,7 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
next(); // must be done
nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_ADD,SQL_LOCK_NO_CHANGE);
}
- OTools::ThrowException(nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
nRet = N3SQLFreeStmt(m_aStatementHandle,SQL_UNBIND);
}
// -------------------------------------------------------------------------
@@ -1032,7 +1038,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
while (nRet == SQL_NEED_DATA);
}
- OTools::ThrowException(nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
// now unbind all columns so we can fetch all columns again with SQLGetData
nRet = N3SQLFreeStmt(m_aStatementHandle,SQL_UNBIND);
}
@@ -1040,7 +1046,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
{
SQLRETURN nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_DELETE,SQL_LOCK_NO_CHANGE);
- OTools::ThrowException(nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
@@ -1076,7 +1082,7 @@ void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException
columnIndex = mapColumn(columnIndex);
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_CHAR,0,0,(sal_Int8*)NULL,NULL,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_CHAR,0,0,(sal_Int8*)NULL,NULL,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
@@ -1088,7 +1094,7 @@ void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) thr
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_BIT,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_BIT,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
@@ -1100,7 +1106,7 @@ void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_CHAR,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_CHAR,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
@@ -1112,7 +1118,7 @@ void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) thro
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_TINYINT,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_TINYINT,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
@@ -1124,7 +1130,7 @@ void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_INTEGER,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_INTEGER,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
@@ -1145,7 +1151,7 @@ void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQ
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_REAL,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_REAL,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
@@ -1157,7 +1163,7 @@ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_DOUBLE,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_DOUBLE,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
@@ -1168,7 +1174,7 @@ void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUSt
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_VARCHAR,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_VARCHAR,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
@@ -1179,7 +1185,7 @@ void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sa
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_BINARY,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_BINARY,0,0,&x,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
@@ -1191,7 +1197,7 @@ void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) thr
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
DATE_STRUCT aVal = OTools::DateToOdbcDate(x);
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_DATE,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_DATE,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
@@ -1204,7 +1210,7 @@ void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) thr
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
TIME_STRUCT aVal = OTools::TimeToOdbcTime(x);
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_TIME,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_TIME,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
@@ -1217,7 +1223,7 @@ void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime
columnIndex = mapColumn(columnIndex);
void* pData = m_aBindVector[columnIndex];
TIMESTAMP_STRUCT aVal = OTools::DateTimeToTimestamp(x);
- OTools::bindValue(m_aStatementHandle,columnIndex,SQL_TIMESTAMP,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
+ OTools::bindValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,SQL_TIMESTAMP,0,0,&aVal,pData,&m_aLengthVector[columnIndex],**this,m_nTextEncoding);
}
// -------------------------------------------------------------------------
@@ -1247,7 +1253,7 @@ void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
// SQLRETURN nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_REFRESH,SQL_LOCK_NO_CHANGE);
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_RELATIVE,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
@@ -1369,7 +1375,7 @@ Any SAL_CALL OResultSet::getBookmark( ) throw( SQLException, RuntimeException)
throw SQLException();
- return makeAny(OTools::getBytesValue(m_aStatementHandle,0,SQL_BINARY,m_bWasNull,**this));
+ return makeAny(OTools::getBytesValue(m_pStatement->getOwnConnection(),m_aStatementHandle,0,SQL_BINARY,m_bWasNull,**this));
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
@@ -1384,7 +1390,7 @@ sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw( SQLE
SQLRETURN nReturn = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_FETCH_BOOKMARK_PTR,aBookmark.getArray(),SQL_IS_POINTER);
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,0);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
}
// -------------------------------------------------------------------------
@@ -1400,7 +1406,7 @@ sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_
SQLRETURN nReturn = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_FETCH_BOOKMARK_PTR,aBookmark.getArray(),SQL_IS_POINTER);
m_nCurrentFetchState = N3SQLFetchScroll(m_aStatementHandle,SQL_FETCH_BOOKMARK,rows);
- OTools::ThrowException(m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pStatement->getOwnConnection(),m_nCurrentFetchState,m_aStatementHandle,SQL_HANDLE_STMT,*this);
return m_nCurrentFetchState == SQL_SUCCESS || m_nCurrentFetchState == SQL_SUCCESS_WITH_INFO;
}
// -------------------------------------------------------------------------
@@ -1514,13 +1520,13 @@ sal_Bool OResultSet::isBookmarkable() const throw( SQLException, RuntimeExcept
return sal_False;
break;
case SQL_CURSOR_STATIC:
- OTools::GetInfo(m_aConnectionHandle,SQL_STATIC_CURSOR_ATTRIBUTES1,nAttr,*(Reference< XInterface >*)this);
+ OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_STATIC_CURSOR_ATTRIBUTES1,nAttr,*(Reference< XInterface >*)this);
break;
case SQL_CURSOR_KEYSET_DRIVEN:
- OTools::GetInfo(m_aConnectionHandle,SQL_KEYSET_CURSOR_ATTRIBUTES1,nAttr,*(Reference< XInterface >*)this);
+ OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_KEYSET_CURSOR_ATTRIBUTES1,nAttr,*(Reference< XInterface >*)this);
break;
case SQL_CURSOR_DYNAMIC:
- OTools::GetInfo(m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nAttr,*(Reference< XInterface >*)this);
+ OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nAttr,*(Reference< XInterface >*)this);
break;
}
sal_uInt32 nUseBookmark = SQL_UB_OFF;
@@ -1642,7 +1648,7 @@ void OResultSet::getFastPropertyValue(
// -------------------------------------------------------------------------
void OResultSet::fillRow(sal_Int32 _nToColumn)
{
- if(m_aRow.size() <= _nToColumn)
+ if((sal_Int32)m_aRow.size() <= _nToColumn)
m_aRow.resize(_nToColumn+1);
m_bFetchData = sal_False;
Reference< XResultSetMetaData > xMeta = getMetaData();
diff --git a/connectivity/source/drivers/odbc/OResultSetMetaData.cxx b/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
index 3645fdd8b9dc..f1913197b7a7 100644
--- a/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
+++ b/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OResultSetMetaData.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-05-02 12:54:55 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,15 +79,15 @@ OResultSetMetaData::~OResultSetMetaData()
::rtl::OUString OResultSetMetaData::getCharColAttrib(sal_Int32 _column,sal_Int32 ident) throw(SQLException, RuntimeException)
{
sal_Int32 column = _column;
- if(_column < m_vMapping.size()) // use mapping
+ if(_column <(sal_Int32) m_vMapping.size()) // use mapping
column = m_vMapping[_column];
sal_Int32 BUFFER_LEN = 128;
char *pName = new char[BUFFER_LEN];
SQLSMALLINT nRealLen=0;
- OTools::ThrowException(N3SQLColAttribute(m_aStatementHandle,
+ OTools::ThrowException(m_pConnection,N3SQLColAttribute(m_aStatementHandle,
(SQLUSMALLINT)column,
- (SQLUSMALLINT)ident,
+ (SQLSMALLINT)ident,
(SQLPOINTER)pName,
BUFFER_LEN,
&nRealLen,
@@ -97,7 +97,7 @@ OResultSetMetaData::~OResultSetMetaData()
{
delete pName;
pName = new char[nRealLen];
- OTools::ThrowException(N3SQLColAttribute(m_aStatementHandle,
+ OTools::ThrowException(m_pConnection,N3SQLColAttribute(m_aStatementHandle,
(SQLUSMALLINT)column,
(SQLUSMALLINT)ident,
(SQLPOINTER)pName,
@@ -113,12 +113,12 @@ OResultSetMetaData::~OResultSetMetaData()
sal_Int32 OResultSetMetaData::getNumColAttrib(sal_Int32 _column,sal_Int32 ident) throw(SQLException, RuntimeException)
{
sal_Int32 column = _column;
- if(_column < m_vMapping.size()) // use mapping
+ if(_column < (sal_Int32)m_vMapping.size()) // use mapping
column = m_vMapping[_column];
sal_Int32 nValue=0;
sal_Int16 nLen = sizeof(nValue);
- OTools::ThrowException(N3SQLColAttribute(m_aStatementHandle,
+ OTools::ThrowException(m_pConnection,N3SQLColAttribute(m_aStatementHandle,
(SQLUSMALLINT)column,
(SQLUSMALLINT)ident,
NULL,
@@ -154,7 +154,7 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, Ru
if(m_nColCount != -1)
return m_nColCount;
sal_Int16 nNumResultCols=0;
- OTools::ThrowException(N3SQLNumResultCols(m_aStatementHandle,&nNumResultCols),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,N3SQLNumResultCols(m_aStatementHandle,&nNumResultCols),m_aStatementHandle,SQL_HANDLE_STMT,*this);
return m_nColCount = nNumResultCols;
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index a5ef4336457d..34ddfbb07551 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OStatement.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:50:18 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,7 +109,7 @@
#endif
#define THROW_SQL(x) \
- OTools::ThrowException(x,m_aStatementHandle,SQL_HANDLE_STMT,*this)
+ OTools::ThrowException(m_pConnection,x,m_aStatementHandle,SQL_HANDLE_STMT,*this)
#ifdef DEBUG
#define DEBUG_THROW \
@@ -165,7 +165,7 @@ void OStatement_BASE2::disposing()
if (N3SQLFreeStmt(m_aStatementHandle,SQL_RESET_PARAMS) ||
N3SQLFreeStmt(m_aStatementHandle,SQL_UNBIND) ||
N3SQLFreeStmt(m_aStatementHandle,SQL_CLOSE))
- OTools::ThrowException(N3SQLFreeStmt(m_aStatementHandle,SQL_DROP),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,N3SQLFreeStmt(m_aStatementHandle,SQL_DROP),m_aStatementHandle,SQL_HANDLE_STMT,*this);
if (m_pConnection)
m_pConnection->release();
@@ -203,7 +203,7 @@ void SAL_CALL OStatement_Base::cancel( ) throw(RuntimeException)
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
- OTools::ThrowException(N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
+ OTools::ThrowException(m_pConnection,N3SQLCancel(m_aStatementHandle),m_aStatementHandle,SQL_HANDLE_STMT,*this);
}
// -------------------------------------------------------------------------
@@ -287,7 +287,11 @@ sal_Bool OStatement_Base::lockIfNecessary (const ::rtl::OUString& sql) throw( SQ
// First, convert the statement to upper case
+#if SUPD > 631
::rtl::OUString sqlStatement = sql.toAsciiUpperCase ();
+#else
+ ::rtl::OUString sqlStatement = sql.toUpperCase ();
+#endif
// Now, look for the FOR UPDATE keywords. If there is any extra white
// space between the FOR and UPDATE, this will fail.
@@ -916,7 +920,7 @@ void OStatement_Base::setCursorName(const ::rtl::OUString &_par0) throw(SQLExcep
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
::rtl::OString aName(::rtl::OUStringToOString(_par0,getOwnConnection()->getTextEncoding()));
- THROW_SQL(N3SQLSetCursorName(m_aStatementHandle,(SDB_ODBC_CHAR*)aName.getStr(),aName.getLength()));
+ THROW_SQL(N3SQLSetCursorName(m_aStatementHandle,(SDB_ODBC_CHAR*)aName.getStr(),(SQLSMALLINT)aName.getLength()));
}
// -------------------------------------------------------------------------
sal_Bool OStatement_Base::isUsingBookmarks() const throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx
index d4316eb8af58..ccee8733ff43 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OTools.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:11 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,21 +76,27 @@
#ifndef _OSL_DIAGNOSE_H_
#include <osl/diagnose.h>
#endif
+#ifndef _CONNECTIVITY_ODBC_OCONNECTION_HXX_
+#include "odbc/OConnection.hxx"
+#endif
using namespace connectivity::odbc;
using namespace com::sun::star::uno;
using namespace com::sun::star::sdbc;
using namespace com::sun::star::util;
-void OTools::getValue( SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- void* _pValue,SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
+void OTools::getValue( OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SQLSMALLINT _nType,
+ sal_Bool &_bWasNull,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ void* _pValue,
+ SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
SQLINTEGER pcbValue;
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,
+ (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
_nType,
_pValue,
@@ -100,7 +106,8 @@ void OTools::getValue( SQLHANDLE _aStatementHandle,
_bWasNull = pcbValue == SQL_NULL_DATA;
}
// -----------------------------------------------------------------------------
-void OTools::bindParameter(SQLHANDLE _hStmt,
+void OTools::bindParameter( OConnection* _pConnection,
+ SQLHANDLE _hStmt,
sal_Int32 nPos,
sal_Int8* pDataBuffer,
sal_Int8* pLenBuffer,
@@ -128,9 +135,9 @@ void OTools::bindParameter(SQLHANDLE _hStmt,
if(fSqlType == SQL_LONGVARCHAR || fSqlType == SQL_LONGVARBINARY)
memcpy(pData,&nPos,sizeof(nPos));
- nRetcode = N3SQLDescribeParam(_hStmt,(SQLUSMALLINT)nPos,&fSqlType,&nColumnSize,&nDecimalDigits,&nNullable);
+ nRetcode = (*(T3SQLDescribeParam)_pConnection->getOdbcFunction(ODBC3SQLDescribeParam))(_hStmt,(SQLUSMALLINT)nPos,&fSqlType,&nColumnSize,&nDecimalDigits,&nNullable);
- nRetcode = N3SQLBindParameter(_hStmt,
+ nRetcode = (*(T3SQLBindParameter)_pConnection->getOdbcFunction(ODBC3SQLBindParameter))(_hStmt,
(SQLUSMALLINT)nPos,
SQL_PARAM_INPUT,
fCType,
@@ -141,7 +148,7 @@ void OTools::bindParameter(SQLHANDLE _hStmt,
nMaxLen,
pLen);
- OTools::ThrowException(nRetcode,_hStmt,SQL_HANDLE_STMT,_xInterface);
+ OTools::ThrowException(_pConnection,nRetcode,_hStmt,SQL_HANDLE_STMT,_xInterface);
}
// -----------------------------------------------------------------------------
void OTools::bindData( SWORD fSqlType,
@@ -254,16 +261,17 @@ void OTools::bindData( SWORD fSqlType,
}
}
// -------------------------------------------------------------------------
-void OTools::bindValue( SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- SQLSMALLINT _nMaxLen,
- SQLSMALLINT _nScale,
- const void* _pValue,
- void* _pData,
- SQLINTEGER *pLen,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
+void OTools::bindValue( OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SQLSMALLINT _nType,
+ SQLSMALLINT _nMaxLen,
+ SQLSMALLINT _nScale,
+ const void* _pValue,
+ void* _pData,
+ SQLINTEGER *pLen,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
SQLRETURN nRetcode;
SWORD fSqlType;
@@ -372,7 +380,7 @@ void OTools::bindValue( SQLHANDLE _aStatementHandle,
if (columnIndex != 0 && !_pValue)
{
*pLen = SQL_NULL_DATA;
- nRetcode = N3SQLBindCol(_aStatementHandle,
+ nRetcode = (*(T3SQLBindCol)_pConnection->getOdbcFunction(ODBC3SQLBindCol))(_aStatementHandle,
columnIndex,
fCType,
_pData,
@@ -488,7 +496,7 @@ void OTools::bindValue( SQLHANDLE _aStatementHandle,
// bindData< T >(fSqlType,sal_False,_pData,pLen,_pValue);
- nRetcode = N3SQLBindCol(_aStatementHandle,
+ nRetcode = (*(T3SQLBindCol)_pConnection->getOdbcFunction(ODBC3SQLBindCol))(_aStatementHandle,
columnIndex,
fCType,
_pData,
@@ -497,10 +505,16 @@ void OTools::bindValue( SQLHANDLE _aStatementHandle,
);
}
- OTools::ThrowException(nRetcode,_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
+ OTools::ThrowException(_pConnection,nRetcode,_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
}
// -----------------------------------------------------------------------------
-void OTools::ThrowException(SQLRETURN _rRetCode,SQLHANDLE _pContext,SQLSMALLINT _nHandleType,const Reference< XInterface >& _xInterface,sal_Bool _bNoFound,rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
+void OTools::ThrowException(OConnection* _pConnection,
+ SQLRETURN _rRetCode,
+ SQLHANDLE _pContext,
+ SQLSMALLINT _nHandleType,
+ const Reference< XInterface >& _xInterface,
+ sal_Bool _bNoFound,
+ rtl_TextEncoding _nTextEncoding) throw(SQLException)
{
switch(_rRetCode)
{
@@ -536,7 +550,7 @@ void OTools::ThrowException(SQLRETURN _rRetCode,SQLHANDLE _pContext,SQLSMALLINT
// Statements zu dieser Verbindung [was in unserem Fall wahrscheinlich gleichbedeutend ist,
// aber das Reference Manual drueckt sich da nicht so klar aus ...].
// Entsprechend bei hdbc.
- SQLRETURN n = N3SQLGetDiagRec(_nHandleType,_pContext,1,
+ SQLRETURN n = (*(T3SQLGetDiagRec)_pConnection->getOdbcFunction(ODBC3SQLGetDiagRec))(_nHandleType,_pContext,1,
szSqlState,
&pfNativeError,
szErrorMessage,sizeof szErrorMessage - 1,&pcbErrorMsg);
@@ -553,8 +567,12 @@ void OTools::ThrowException(SQLRETURN _rRetCode,SQLHANDLE _pContext,SQLSMALLINT
}
// -------------------------------------------------------------------------
-Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 columnIndex,SWORD _fSqlType,sal_Bool &_bWasNull,
- const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
+Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SWORD _fSqlType,
+ sal_Bool &_bWasNull,
+ const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
{
char aCharArray[2048];
// Erstmal versuchen, die Daten mit dem kleinen Puffer
@@ -562,7 +580,7 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
SQLINTEGER nMaxLen = sizeof aCharArray - 1;
// GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
SQLINTEGER pcbValue = 0;
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_BINARY,
&aCharArray,
@@ -594,7 +612,7 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
// Solange eine "truncation"-Warnung vorliegt, weiter Daten abholen
// GETDATA(SQL_C_CHAR,aCharArray, nLen + 1);
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_BINARY,
&aCharArray,
@@ -608,8 +626,13 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
return aData;
}
// -------------------------------------------------------------------------
-::rtl::OUString OTools::getStringValue(SQLHANDLE _aStatementHandle,sal_Int32 columnIndex,SWORD _fSqlType,sal_Bool &_bWasNull,
- const Reference< XInterface >& _xInterface,rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
+::rtl::OUString OTools::getStringValue(OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SWORD _fSqlType,
+ sal_Bool &_bWasNull,
+ const Reference< XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
{
::rtl::OUString aData;
switch(_fSqlType)
@@ -624,7 +647,7 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
// GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode));
SQLINTEGER pcbValue=0;
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_WCHAR,
&waCharArray,
@@ -656,7 +679,7 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
// Solange eine "truncation"-Warnung vorliegt, weiter Daten abholen
// GETDATA(SQL_C_CHAR,waCharArray, nLen + 1);
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_WCHAR,
&waCharArray,
@@ -677,7 +700,7 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
SDWORD nMaxLen = sizeof aCharArray - 1;
// GETDATA(SQL_C_CHAR,aCharArray,nMaxLen);
SQLINTEGER pcbValue = 0;
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_CHAR,
&aCharArray,
@@ -708,7 +731,7 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
// Solange eine "truncation"-Warnung vorliegt, weiter Daten abholen
// GETDATA(SQL_C_CHAR,aCharArray, nLen + 1);
- OTools::ThrowException(N3SQLGetData(_aStatementHandle,
+ OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle,
(SQLUSMALLINT)columnIndex,
SQL_C_CHAR,
&aCharArray,
@@ -728,32 +751,45 @@ Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 c
return aData;
}
// -------------------------------------------------------------------------
-void OTools::GetInfo(SQLHANDLE _aConnectionHandle,SQLUSMALLINT _nInfo,::rtl::OUString &_rValue,const Reference< XInterface >& _xInterface,rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
+void OTools::GetInfo(OConnection* _pConnection,
+ SQLHANDLE _aConnectionHandle,
+ SQLUSMALLINT _nInfo,
+ ::rtl::OUString &_rValue,
+ const Reference< XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
{
char aValue[512];
SQLSMALLINT nValueLen=0;
- OTools::ThrowException(
- N3SQLGetInfo(_aConnectionHandle,_nInfo,aValue,sizeof aValue,&nValueLen),
+ OTools::ThrowException(_pConnection,
+ (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,aValue,sizeof aValue,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
_rValue = ::rtl::OUString(aValue,nValueLen,_nTextEncoding);
}
// -------------------------------------------------------------------------
-void OTools::GetInfo(SQLHANDLE _aConnectionHandle,SQLUSMALLINT _nInfo,sal_Int32 &_rValue,const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
+void OTools::GetInfo(OConnection* _pConnection,
+ SQLHANDLE _aConnectionHandle,
+ SQLUSMALLINT _nInfo,
+ sal_Int32 &_rValue,
+ const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
{
SQLSMALLINT nValueLen;
_rValue = 0; // in case the driver uses only 16 of the 32 bits (as it does, for example, for SQL_CATALOG_LOCATION)
- OTools::ThrowException(
- N3SQLGetInfo(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
+ OTools::ThrowException(_pConnection,
+ (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
_aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
}
// -------------------------------------------------------------------------
-void OTools::GetInfo(SQLHANDLE _aConnectionHandle,SQLUSMALLINT _nInfo,sal_Bool &_rValue,const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
+void OTools::GetInfo(OConnection* _pConnection,
+ SQLHANDLE _aConnectionHandle,
+ SQLUSMALLINT _nInfo,
+ sal_Bool &_rValue,
+ const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException)
{
SQLSMALLINT nValueLen;
- OTools::ThrowException(
- N3SQLGetInfo(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
- _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
+ OTools::ThrowException(_pConnection,
+ (*(T3SQLGetInfo)_pConnection->getOdbcFunction(ODBC3SQLGetInfo))(_aConnectionHandle,_nInfo,&_rValue,sizeof _rValue,&nValueLen),
+ _aConnectionHandle,SQL_HANDLE_DBC,_xInterface);
}
// -------------------------------------------------------------------------
sal_Int32 OTools::MapOdbcType2Jdbc(sal_Int32 _nType)
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
index bebf64345dc1..a7909b975607 100644
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ b/connectivity/source/drivers/odbc/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.9 $
+# $Revision: 1.10 $
#
-# last change: $Author: oj $ $Date: 2001-05-14 11:34:11 $
+# last change: $Author: oj $ $Date: 2001-05-15 08:18:13 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -90,7 +90,6 @@ SLOFILES=\
$(SLO)$/ODatabaseMetaDataResultSet.obj \
$(SLO)$/ODatabaseMetaData.obj \
$(SLO)$/ODriver.obj \
- $(SLO)$/OFunctions.obj \
$(SLO)$/OConnection.obj
@@ -121,7 +120,9 @@ DEFLIB1NAME=$(TARGET)
# --- ODBC Library -----------------------------------
# --- Files -------------------------------------
SLO2FILES=\
- $(SLO)$/oservices.obj
+ $(SLO)$/oservices.obj \
+ $(SLO)$/ORealDriver.obj \
+ $(SLO)$/OFunctions.obj
# --- ODBC Library -----------------------------------
SHL2TARGET= $(ODBC_TARGET)$(ODBC_MAJOR)
diff --git a/connectivity/source/inc/adabas/BDriver.hxx b/connectivity/source/inc/adabas/BDriver.hxx
index eebeb2703848..8a7fc3dee9eb 100644
--- a/connectivity/source/inc/adabas/BDriver.hxx
+++ b/connectivity/source/inc/adabas/BDriver.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BDriver.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2001-04-30 10:13:39 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,6 +101,7 @@ namespace connectivity
ODriver();
~ODriver(){}
+ virtual void* getOdbcFunction(sal_Int32 _nIndex) const;
// OComponentHelper
virtual void SAL_CALL disposing(void);
// XInterface
diff --git a/connectivity/source/inc/odbc/OConnection.hxx b/connectivity/source/inc/odbc/OConnection.hxx
index 2cea63d2f476..2ab447d72661 100644
--- a/connectivity/source/inc/odbc/OConnection.hxx
+++ b/connectivity/source/inc/odbc/OConnection.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OConnection.hxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: oj $ $Date: 2001-05-04 09:58:44 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -135,7 +135,9 @@ namespace connectivity
SQLRETURN OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, sal_Bool bSilent);
void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
+
public:
+ void* getOdbcFunction(sal_Int32 _nIndex) const;
virtual SQLRETURN Construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver);
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaData.hxx b/connectivity/source/inc/odbc/ODatabaseMetaData.hxx
index 5242b02513e8..eb265d400e55 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaData.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaData.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaData.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2001-04-20 13:31:58 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -84,6 +84,12 @@ namespace connectivity
sal_Bool m_bUseCatalog;
public:
+ inline OConnection* getOwnConnection() const { return m_pConnection; }
+ inline void* getOdbcFunction(sal_Int32 _nIndex) const
+ {
+ return m_pConnection->getOdbcFunction(_nIndex);
+ }
+
ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon);
~ODatabaseMetaData();
// XDatabaseMetaData
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index dd33590ea1d7..2364e05c2578 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODatabaseMetaDataResultSet.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-05-02 12:52:25 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,6 +98,9 @@
#ifndef _CONNECTIVITY_ODBC_OSTATEMENT_HXX_
#include "odbc/OStatement.hxx"
#endif
+#ifndef _CONNECTIVITY_ODBC_ODATABASEMETADATA_HXX_
+#include "odbc/ODatabaseMetaData.hxx"
+#endif
#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
#include <comphelper/broadcasthelper.hxx>
#endif
@@ -144,6 +147,7 @@ namespace connectivity
::com::sun::star::uno::WeakReferenceHelper m_aStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
SQLUSMALLINT* m_pRowStatusArray;
+ OConnection* m_pConnection;
rtl_TextEncoding m_nTextEncoding;
sal_Int32 m_nRowPos;
sal_Int32 m_nLastColumnPos; // used for m_aRow just to know where we are
@@ -192,9 +196,13 @@ namespace connectivity
) const;
public:
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- ODatabaseMetaDataResultSet( SQLHANDLE _pStatementHandle,rtl_TextEncoding _nTextEncoding);
+ ODatabaseMetaDataResultSet(OConnection* _pConnection,SQLHANDLE _pStatementHandle,rtl_TextEncoding _nTextEncoding);
~ODatabaseMetaDataResultSet();
+ inline void* getOdbcFunction(sal_Int32 _nIndex) const
+ {
+ return m_pConnection->getOdbcFunction(_nIndex);
+ }
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing(void);
// XInterface
diff --git a/connectivity/source/inc/odbc/ODriver.hxx b/connectivity/source/inc/odbc/ODriver.hxx
index d11769c582b5..6011186b9bec 100644
--- a/connectivity/source/inc/odbc/ODriver.hxx
+++ b/connectivity/source/inc/odbc/ODriver.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODriver.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:14:27 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,7 @@
#include "connectivity/CommonTools.hxx"
#endif
+
namespace connectivity
{
namespace odbc
@@ -97,11 +98,14 @@ namespace connectivity
SQLHANDLE m_pDriverHandle;
- virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath);
+ virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath) = 0;
+
public:
ODBCDriver();
+ // only possibility to get the odbc functions
+ virtual void* getOdbcFunction(sal_Int32 _nIndex) const = 0;
// OComponentHelper
virtual void SAL_CALL disposing(void);
// XInterface
diff --git a/connectivity/source/inc/odbc/OFunctions.hxx b/connectivity/source/inc/odbc/OFunctions.hxx
index bbfeefb91351..65aed836ecf6 100644
--- a/connectivity/source/inc/odbc/OFunctions.hxx
+++ b/connectivity/source/inc/odbc/OFunctions.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OFunctions.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:14:27 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,18 +75,18 @@
namespace connectivity
{
- sal_Bool LoadFunctions(oslModule pODBCso, sal_Bool _bDS=sal_True);
- sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath);
- sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath);
+// sal_Bool LoadFunctions(oslModule pODBCso, sal_Bool _bDS=sal_True);
+// sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath);
+// sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath);
// Connecting to a data source
typedef SQLRETURN (SQL_API *T3SQLAllocHandle) (SQLSMALLINT HandleType,SQLHANDLE InputHandle,SQLHANDLE * OutputHandlePtr);
- extern T3SQLAllocHandle pODBC3SQLAllocHandle;
- #define N3SQLAllocHandle(a,b,c) (*pODBC3SQLAllocHandle)(a,b,c)
+
+ #define N3SQLAllocHandle(a,b,c) (*(T3SQLAllocHandle)getOdbcFunction(ODBC3SQLAllocHandle))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLConnect) (SQLHDBC ConnectionHandle,SQLCHAR *ServerName,SQLSMALLINT NameLength1,SQLCHAR *UserName,SQLSMALLINT NameLength2,SQLCHAR *Authentication,SQLSMALLINT NameLength3);
- extern T3SQLConnect pODBC3SQLConnect;
- #define N3SQLConnect(a,b,c,d,e,f,g) (*pODBC3SQLConnect)(a,b,c,d,e,f,g)
+
+ #define N3SQLConnect(a,b,c,d,e,f,g) (*(T3SQLConnect)getOdbcFunction(ODBC3SQLConnect))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLDriverConnect) ( SQLHDBC ConnectionHandle,
HWND WindowHandle,
@@ -96,8 +96,8 @@ namespace connectivity
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLength2Ptr,
SQLUSMALLINT DriverCompletion);
- extern T3SQLDriverConnect pODBC3SQLDriverConnect;
- #define N3SQLDriverConnect(a,b,c,d,e,f,g,h) (*pODBC3SQLDriverConnect)(a,b,c,d,e,f,g,h)
+
+ #define N3SQLDriverConnect(a,b,c,d,e,f,g,h) (*(T3SQLDriverConnect)getOdbcFunction(ODBC3SQLDriverConnect))(a,b,c,d,e,f,g,h)
typedef SQLRETURN (SQL_API *T3SQLBrowseConnect) ( SQLHDBC ConnectionHandle,
SQLCHAR * InConnectionString,
@@ -105,8 +105,8 @@ namespace connectivity
SQLCHAR * OutConnectionString,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLength2Ptr);
- extern T3SQLBrowseConnect pODBC3SQLBrowseConnect;
- #define N3SQLBrowseConnect(a,b,c,d,e,f) (*pODBC3SQLBrowseConnect)(a,b,c,d,e,f)
+
+ #define N3SQLBrowseConnect(a,b,c,d,e,f) (*(T3SQLBrowseConnect)getOdbcFunction(ODBC3SQLBrowseConnect))(a,b,c,d,e,f)
// Obtaining information about a driver and data source
typedef SQLRETURN (SQL_API *T3SQLDataSources) ( SQLHENV EnvironmentHandle,
@@ -117,8 +117,8 @@ namespace connectivity
SQLCHAR * Description,
SQLSMALLINT BufferLength2,
SQLSMALLINT * NameLength2Ptr);
- extern T3SQLDataSources pODBC3SQLDataSources;
- #define N3SQLDataSources(a,b,c,d,e,f,g,h) (*pODBC3SQLDataSources)(a,b,c,d,e,f,g,h)
+
+ #define N3SQLDataSources(a,b,c,d,e,f,g,h) (*(T3SQLDataSources)getOdbcFunction(ODBC3SQLDataSources))(a,b,c,d,e,f,g,h)
typedef SQLRETURN (SQL_API *T3SQLDrivers) ( SQLHENV EnvironmentHandle,
SQLUSMALLINT Direction,
@@ -128,75 +128,75 @@ namespace connectivity
SQLCHAR * DriverAttributes,
SQLSMALLINT BufferLength2,
SQLSMALLINT * AttributesLengthPtr);
- extern T3SQLDrivers pODBC3SQLDrivers;
- #define N3SQLDrivers(a,b,c,d,e,f,g,h) (*pODBC3SQLDrivers)(a,b,c,d,e,f,g,h)
+
+ #define N3SQLDrivers(a,b,c,d,e,f,g,h) (*(T3SQLDrivers)getOdbcFunction(ODBC3SQLDrivers))(a,b,c,d,e,f,g,h)
typedef SQLRETURN (SQL_API *T3SQLGetInfo) ( SQLHDBC ConnectionHandle,
SQLUSMALLINT InfoType,
SQLPOINTER InfoValuePtr,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr);
- extern T3SQLGetInfo pODBC3SQLGetInfo;
- #define N3SQLGetInfo(a,b,c,d,e) (*pODBC3SQLGetInfo)(a,b,c,d,e)
+
+ #define N3SQLGetInfo(a,b,c,d,e) (*(T3SQLGetInfo)getOdbcFunction(ODBC3SQLGetInfo))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLGetFunctions) (SQLHDBC ConnectionHandle,
SQLUSMALLINT FunctionId,
SQLUSMALLINT * SupportedPtr);
- extern T3SQLGetFunctions pODBC3SQLGetFunctions;
- #define N3SQLGetFunctions(a,b,c) (*pODBC3SQLGetFunctions)(a,b,c)
+
+ #define N3SQLGetFunctions(a,b,c) (*(T3SQLGetFunctions)getOdbcFunction(ODBC3SQLGetFunctions))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLGetTypeInfo) ( SQLHSTMT StatementHandle,
SQLSMALLINT DataType);
- extern T3SQLGetTypeInfo pODBC3SQLGetTypeInfo;
- #define N3SQLGetTypeInfo(a,b) (*pODBC3SQLGetTypeInfo)(a,b)
+
+ #define N3SQLGetTypeInfo(a,b) (*(T3SQLGetTypeInfo)getOdbcFunction(ODBC3SQLGetTypeInfo))(a,b)
// Setting and retrieving driver attributes
typedef SQLRETURN (SQL_API *T3SQLSetConnectAttr)(SQLHDBC ConnectionHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER StringLength);
- extern T3SQLSetConnectAttr pODBC3SQLSetConnectAttr;
- #define N3SQLSetConnectAttr(a,b,c,d) (*pODBC3SQLSetConnectAttr)(a,b,c,d)
+
+ #define N3SQLSetConnectAttr(a,b,c,d) (*(T3SQLSetConnectAttr)getOdbcFunction(ODBC3SQLSetConnectAttr))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLGetConnectAttr) (SQLHDBC ConnectionHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER* StringLength);
- extern T3SQLGetConnectAttr pODBC3SQLGetConnectAttr;
- #define N3SQLGetConnectAttr(a,b,c,d,e) (*pODBC3SQLGetConnectAttr)(a,b,c,d,e)
+
+ #define N3SQLGetConnectAttr(a,b,c,d,e) (*(T3SQLGetConnectAttr)getOdbcFunction(ODBC3SQLGetConnectAttr))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLSetEnvAttr) ( SQLHENV EnvironmentHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER StringLength);
- extern T3SQLSetEnvAttr pODBC3SQLSetEnvAttr;
- #define N3SQLSetEnvAttr(a,b,c,d) (*pODBC3SQLSetEnvAttr)(a,b,c,d)
+
+ #define N3SQLSetEnvAttr(a,b,c,d) (*(T3SQLSetEnvAttr)getOdbcFunction(ODBC3SQLSetEnvAttr))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLGetEnvAttr) ( SQLHENV EnvironmentHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER* StringLength);
- extern T3SQLGetEnvAttr pODBC3SQLGetEnvAttr;
- #define N3SQLGetEnvAttr(a,b,c,d,e) (*pODBC3SQLGetEnvAttr)(a,b,c,d,e)
+
+ #define N3SQLGetEnvAttr(a,b,c,d,e) (*(T3SQLGetEnvAttr)getOdbcFunction(ODBC3SQLGetEnvAttr))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLSetStmtAttr) ( SQLHSTMT StatementHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER StringLength);
- extern T3SQLSetStmtAttr pODBC3SQLSetStmtAttr;
- #define N3SQLSetStmtAttr(a,b,c,d) (*pODBC3SQLSetStmtAttr)(a,b,c,d)
+
+ #define N3SQLSetStmtAttr(a,b,c,d) (*(T3SQLSetStmtAttr)getOdbcFunction(ODBC3SQLSetStmtAttr))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLGetStmtAttr) ( SQLHSTMT StatementHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER* StringLength);
- extern T3SQLGetStmtAttr pODBC3SQLGetStmtAttr;
- #define N3SQLGetStmtAttr(a,b,c,d,e) (*pODBC3SQLGetStmtAttr)(a,b,c,d,e)
+
+ #define N3SQLGetStmtAttr(a,b,c,d,e) (*(T3SQLGetStmtAttr)getOdbcFunction(ODBC3SQLGetStmtAttr))(a,b,c,d,e)
// Setting and retrieving descriptor fields
/*typedef SQLRETURN (SQL_API *T3SQLSetDescField) (SQLHDESC DescriptorHandle,
@@ -204,8 +204,8 @@ namespace connectivity
SQLSMALLINT FieldIdentifier,
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength);
- extern T3SQLSetDescField pODBC3SQLSetDescField;
- #define N3SQLSetDescField(a,b,c,d,e) (*pODBC3SQLSetDescField)(a,b,c,d,e)
+
+ #define N3SQLSetDescField(a,b,c,d,e) (*(T3SQLSetDescField)getOdbcFunction(ODBC3SQLSetDescField))(a,b,c,d,e)
typedef SQLRETURN (SQL_API *T3SQLGetDescField) ( SQLHDESC DescriptorHandle,
SQLSMALLINT RecNumber,
@@ -213,8 +213,8 @@ namespace connectivity
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER * StringLengthPtr);
- extern T3SQLGetDescField pODBC3SQLGetDescField;
- #define N3SQLGetDescField(a,b,c,d,e,f) (*pODBC3SQLGetDescField)(a,b,c,d,e,f)
+
+ #define N3SQLGetDescField(a,b,c,d,e,f) (*(T3SQLGetDescField)getOdbcFunction(ODBC3SQLGetDescField))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLGetDescRec) ( SQLHDESC DescriptorHandle,
@@ -228,8 +228,8 @@ namespace connectivity
SQLSMALLINT * PrecisionPtr,
SQLSMALLINT * ScalePtr,
SQLSMALLINT * NullablePtr);
- extern T3SQLGetDescRec pODBC3SQLGetDescRec;
- #define N3SQLGetDescRec(a,b,c,d,e,f,g,h,i,j,k) (*pODBC3SQLGetDescRec)(a,b,c,d,e,f,g,h,i,j,k)
+
+ #define N3SQLGetDescRec(a,b,c,d,e,f,g,h,i,j,k) (*(T3SQLGetDescRec)getOdbcFunction(ODBC3SQLGetDescRec))(a,b,c,d,e,f,g,h,i,j,k)
typedef SQLRETURN (SQL_API *T3SQLSetDescRec) ( SQLHDESC DescriptorHandle,
@@ -242,16 +242,16 @@ namespace connectivity
SQLPOINTER DataPtr,
SQLINTEGER * StringLengthPtr,
SQLINTEGER * IndicatorPtr);
- extern T3SQLSetDescRec pODBC3SQLSetDescRec;
- #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*pODBC3SQLSetDescRec)(a,b,c,d,e,f,g,h,i,j)
+
+ #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j)
*/
// Preparing SQL requests
typedef SQLRETURN (SQL_API *T3SQLPrepare) ( SQLHSTMT StatementHandle,
SQLCHAR * StatementText,
SQLINTEGER TextLength);
- extern T3SQLPrepare pODBC3SQLPrepare;
- #define N3SQLPrepare(a,b,c) (*pODBC3SQLPrepare)(a,b,c)
+
+ #define N3SQLPrepare(a,b,c) (*(T3SQLPrepare)getOdbcFunction(ODBC3SQLPrepare))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLBindParameter) (SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
@@ -263,33 +263,33 @@ namespace connectivity
SQLPOINTER ParameterValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER * StrLen_or_IndPtr);
- extern T3SQLBindParameter pODBC3SQLBindParameter;
- #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*pODBC3SQLBindParameter)(a,b,c,d,e,f,g,h,i,j)
+
+ #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j)
/*typedef SQLRETURN (SQL_API *T3SQLGetCursorName) (SQLHSTMT StatementHandle,
SQLCHAR * CursorName,
SQLSMALLINT BufferLength,
SQLSMALLINT * NameLengthPtr);
- extern T3SQLGetCursorName pODBC3SQLGetCursorName;
- #define N3SQLGetCursorName(a,b,c,d) (*pODBC3SQLGetCursorName)(a,b,c,d)
+
+ #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d)
*/
typedef SQLRETURN (SQL_API *T3SQLSetCursorName) (SQLHSTMT StatementHandle,
SQLCHAR * CursorName,
SQLSMALLINT NameLength);
- extern T3SQLSetCursorName pODBC3SQLSetCursorName;
- #define N3SQLSetCursorName(a,b,c) (*pODBC3SQLSetCursorName)(a,b,c)
+
+ #define N3SQLSetCursorName(a,b,c) (*(T3SQLSetCursorName)getOdbcFunction(ODBC3SQLSetCursorName))(a,b,c)
// Submitting requests
typedef SQLRETURN (SQL_API *T3SQLExecute) ( SQLHSTMT StatementHandle);
- extern T3SQLExecute pODBC3SQLExecute;
- #define N3SQLExecute(a) (*pODBC3SQLExecute)(a)
+
+ #define N3SQLExecute(a) (*(T3SQLExecute)getOdbcFunction(ODBC3SQLExecute))(a)
typedef SQLRETURN (SQL_API *T3SQLExecDirect) ( SQLHSTMT StatementHandle,
SQLCHAR * StatementText,
SQLINTEGER TextLength);
- extern T3SQLExecDirect pODBC3SQLExecDirect;
- #define N3SQLExecDirect(a,b,c) (*pODBC3SQLExecDirect)(a,b,c)
+
+ #define N3SQLExecDirect(a,b,c) (*(T3SQLExecDirect)getOdbcFunction(ODBC3SQLExecDirect))(a,b,c)
/*typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHDBC ConnectionHandle,
SQLCHAR * InStatementText,
@@ -297,8 +297,8 @@ namespace connectivity
SQLCHAR * utStatementText,
SQLINTEGER BufferLength,
SQLINTEGER * TextLength2Ptr);
- extern T3SQLNativeSql pODBC3SQLNativeSql;
- #define N3SQLNativeSql(a,b,c,d,e,f) (*pODBC3SQLNativeSql)(a,b,c,d,e,f)*/
+
+ #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)*/
typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
@@ -306,35 +306,35 @@ namespace connectivity
SQLUINTEGER * ParameterSizePtr,
SQLSMALLINT * DecimalDigitsPtr,
SQLSMALLINT * NullablePtr);
- extern T3SQLDescribeParam pODBC3SQLDescribeParam;
- #define N3SQLDescribeParam(a,b,c,d,e,f) (*pODBC3SQLDescribeParam)(a,b,c,d,e,f)
+
+ #define N3SQLDescribeParam(a,b,c,d,e,f) (*(T3SQLDescribeParam)getOdbcFunction(ODBC3SQLDescribeParam))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLNumParams) ( SQLHSTMT StatementHandle,
SQLSMALLINT * ParameterCountPtr);
- extern T3SQLNumParams pODBC3SQLNumParams;
- #define N3SQLNumParams(a,b) (*pODBC3SQLNumParams)(a,b)
+
+ #define N3SQLNumParams(a,b) (*(T3SQLNumParams)getOdbcFunction(ODBC3SQLNumParams))(a,b)
typedef SQLRETURN (SQL_API *T3SQLParamData) ( SQLHSTMT StatementHandle,
SQLPOINTER * ValuePtrPtr);
- extern T3SQLParamData pODBC3SQLParamData;
- #define N3SQLParamData(a,b) (*pODBC3SQLParamData)(a,b)
+
+ #define N3SQLParamData(a,b) (*(T3SQLParamData)getOdbcFunction(ODBC3SQLParamData))(a,b)
typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle,
SQLPOINTER DataPtr,
SQLINTEGER StrLen_or_Ind);
- extern T3SQLPutData pODBC3SQLPutData;
- #define N3SQLPutData(a,b,c) (*pODBC3SQLPutData)(a,b,c)
+
+ #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c)
// Retrieving results and information about results
typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle,
SQLINTEGER * RowCountPtr);
- extern T3SQLRowCount pODBC3SQLRowCount;
- #define N3SQLRowCount(a,b) (*pODBC3SQLRowCount)(a,b)
+
+ #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b)
typedef SQLRETURN (SQL_API *T3SQLNumResultCols) (SQLHSTMT StatementHandle,
SQLSMALLINT * ColumnCountPtr);
- extern T3SQLNumResultCols pODBC3SQLNumResultCols;
- #define N3SQLNumResultCols(a,b) (*pODBC3SQLNumResultCols)(a,b)
+
+ #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b)
typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle,
SQLSMALLINT ColumnNumber,
@@ -345,8 +345,8 @@ namespace connectivity
SQLUINTEGER * ColumnSizePtr,
SQLSMALLINT * DecimalDigitsPtr,
SQLSMALLINT * NullablePtr);
- extern T3SQLDescribeCol pODBC3SQLDescribeCol;
- #define N3SQLDescribeCol(a,b,c,d,e,f,g,h,i) (*pODBC3SQLDescribeCol)(a,b,c,d,e,f,g,h,i)
+
+ #define N3SQLDescribeCol(a,b,c,d,e,f,g,h,i) (*(T3SQLDescribeCol)getOdbcFunction(ODBC3SQLDescribeCol))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLColAttribute) (SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -355,8 +355,8 @@ namespace connectivity
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr,
SQLPOINTER NumericAttributePtr);
- extern T3SQLColAttribute pODBC3SQLColAttribute;
- #define N3SQLColAttribute(a,b,c,d,e,f,g) (*pODBC3SQLColAttribute)(a,b,c,d,e,f,g)
+
+ #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLBindCol) ( SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -364,18 +364,18 @@ namespace connectivity
SQLPOINTER TargetValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER * StrLen_or_IndPtr);
- extern T3SQLBindCol pODBC3SQLBindCol;
- #define N3SQLBindCol(a,b,c,d,e,f) (*pODBC3SQLBindCol)(a,b,c,d,e,f)
+
+ #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLFetch) ( SQLHSTMT StatementHandle);
- extern T3SQLFetch pODBC3SQLFetch;
- #define N3SQLFetch(a) (*pODBC3SQLFetch)(a)
+
+ #define N3SQLFetch(a) (*(T3SQLFetch)getOdbcFunction(ODBC3SQLFetch))(a)
typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle,
SQLSMALLINT FetchOrientation,
SQLINTEGER FetchOffset);
- extern T3SQLFetchScroll pODBC3SQLFetchScroll;
- #define N3SQLFetchScroll(a,b,c) (*pODBC3SQLFetchScroll)(a,b,c)
+
+ #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c)
typedef SQLRETURN (SQL_API *T3SQLGetData) ( SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
@@ -383,24 +383,24 @@ namespace connectivity
SQLPOINTER TargetValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER * StrLen_or_IndPtr);
- extern T3SQLGetData pODBC3SQLGetData;
- #define N3SQLGetData(a,b,c,d,e,f) (*pODBC3SQLGetData)(a,b,c,d,e,f)
+
+ #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f)
typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle,
SQLUSMALLINT RowNumber,
SQLUSMALLINT Operation,
SQLUSMALLINT LockType);
- extern T3SQLSetPos pODBC3SQLSetPos;
- #define N3SQLSetPos(a,b,c,d) (*pODBC3SQLSetPos)(a,b,c,d)
+
+ #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle,
SQLUSMALLINT Operation);
- extern T3SQLBulkOperations pODBC3SQLBulkOperations;
- #define N3SQLBulkOperations(a,b) (*pODBC3SQLBulkOperations)(a,b)
+
+ #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b)
typedef SQLRETURN (SQL_API *T3SQLMoreResults) ( SQLHSTMT StatementHandle);
- extern T3SQLMoreResults pODBC3SQLMoreResults;
- #define N3SQLMoreResults(a) (*pODBC3SQLMoreResults)(a)
+
+ #define N3SQLMoreResults(a) (*(T3SQLMoreResults)getOdbcFunction(ODBC3SQLMoreResults))(a)
/*typedef SQLRETURN (SQL_API *T3SQLGetDiagField) (SQLSMALLINT HandleType,
SQLHANDLE Handle,
@@ -409,8 +409,8 @@ namespace connectivity
SQLPOINTER DiagInfoPtr,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr);
- extern T3SQLGetDiagField pODBC3SQLGetDiagField;
- #define N3SQLGetDiagField(a,b,c,d,e,f,g) (*pODBC3SQLGetDiagField)(a,b,c,d,e,f,g)*/
+
+ #define N3SQLGetDiagField(a,b,c,d,e,f,g) (*(T3SQLGetDiagField)getOdbcFunction(ODBC3SQLGetDiagField))(a,b,c,d,e,f,g)*/
typedef SQLRETURN (SQL_API *T3SQLGetDiagRec) ( SQLSMALLINT HandleType,
SQLHANDLE Handle,
@@ -421,8 +421,8 @@ namespace connectivity
SQLSMALLINT BufferLength,
SQLSMALLINT * TextLengthPtr);
- extern T3SQLGetDiagRec pODBC3SQLGetDiagRec;
- #define N3SQLGetDiagRec(a,b,c,d,e,f,g,h) (*pODBC3SQLGetDiagRec)(a,b,c,d,e,f,g,h)
+
+ #define N3SQLGetDiagRec(a,b,c,d,e,f,g,h) (*(T3SQLGetDiagRec)getOdbcFunction(ODBC3SQLGetDiagRec))(a,b,c,d,e,f,g,h)
// Obtaining information about the data sources system tables (catalog functions)
typedef SQLRETURN (SQL_API *T3SQLColumnPrivileges) (SQLHSTMT StatementHandle,
@@ -434,8 +434,8 @@ namespace connectivity
SQLSMALLINT NameLength3,
SQLCHAR * ColumnName,
SQLSMALLINT NameLength4);
- extern T3SQLColumnPrivileges pODBC3SQLColumnPrivileges;
- #define N3SQLColumnPrivileges(a,b,c,d,e,f,g,h,i) (*pODBC3SQLColumnPrivileges)(a,b,c,d,e,f,g,h,i)
+
+ #define N3SQLColumnPrivileges(a,b,c,d,e,f,g,h,i) (*(T3SQLColumnPrivileges)getOdbcFunction(ODBC3SQLColumnPrivileges))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLColumns) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -446,8 +446,8 @@ namespace connectivity
SQLSMALLINT NameLength3,
SQLCHAR * ColumnName,
SQLSMALLINT NameLength4);
- extern T3SQLColumns pODBC3SQLColumns;
- #define N3SQLColumns(a,b,c,d,e,f,g,h,i) (*pODBC3SQLColumns)(a,b,c,d,e,f,g,h,i)
+
+ #define N3SQLColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLColumns)getOdbcFunction(ODBC3SQLColumns))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLForeignKeys) ( SQLHSTMT StatementHandle,
SQLCHAR * PKCatalogName,
@@ -462,8 +462,8 @@ namespace connectivity
SQLSMALLINT NameLength5,
SQLCHAR * FKTableName,
SQLSMALLINT NameLength6);
- extern T3SQLForeignKeys pODBC3SQLForeignKeys;
- #define N3SQLForeignKeys(a,b,c,d,e,f,g,h,i,j,k,l,m) (*pODBC3SQLForeignKeys)(a,b,c,d,e,f,g,h,i,j,k,l,m)
+
+ #define N3SQLForeignKeys(a,b,c,d,e,f,g,h,i,j,k,l,m) (*(T3SQLForeignKeys)getOdbcFunction(ODBC3SQLForeignKeys))(a,b,c,d,e,f,g,h,i,j,k,l,m)
typedef SQLRETURN (SQL_API *T3SQLPrimaryKeys) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -472,8 +472,8 @@ namespace connectivity
SQLSMALLINT NameLength2,
SQLCHAR * TableName,
SQLSMALLINT NameLength3);
- extern T3SQLPrimaryKeys pODBC3SQLPrimaryKeys;
- #define N3SQLPrimaryKeys(a,b,c,d,e,f,g) (*pODBC3SQLPrimaryKeys)(a,b,c,d,e,f,g)
+
+ #define N3SQLPrimaryKeys(a,b,c,d,e,f,g) (*(T3SQLPrimaryKeys)getOdbcFunction(ODBC3SQLPrimaryKeys))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLProcedureColumns) (SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -484,8 +484,8 @@ namespace connectivity
SQLSMALLINT NameLength3,
SQLCHAR * ColumnName,
SQLSMALLINT NameLength4);
- extern T3SQLProcedureColumns pODBC3SQLProcedureColumns;
- #define N3SQLProcedureColumns(a,b,c,d,e,f,g,h,i) (*pODBC3SQLProcedureColumns)(a,b,c,d,e,f,g,h,i)
+
+ #define N3SQLProcedureColumns(a,b,c,d,e,f,g,h,i) (*(T3SQLProcedureColumns)getOdbcFunction(ODBC3SQLProcedureColumns))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLProcedures) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -494,8 +494,8 @@ namespace connectivity
SQLSMALLINT NameLength2,
SQLCHAR * ProcName,
SQLSMALLINT NameLength3);
- extern T3SQLProcedures pODBC3SQLProcedures;
- #define N3SQLProcedures(a,b,c,d,e,f,g) (*pODBC3SQLProcedures)(a,b,c,d,e,f,g)
+
+ #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle,
SQLSMALLINT IdentifierType,
@@ -507,8 +507,8 @@ namespace connectivity
SQLSMALLINT NameLength3,
SQLSMALLINT Scope,
SQLSMALLINT Nullable);
- extern T3SQLSpecialColumns pODBC3SQLSpecialColumns;
- #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*pODBC3SQLSpecialColumns)(a,b,c,d,e,f,g,h,i,j)
+
+ #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j)
typedef SQLRETURN (SQL_API *T3SQLStatistics) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -519,8 +519,8 @@ namespace connectivity
SQLSMALLINT NameLength3,
SQLUSMALLINT Unique,
SQLUSMALLINT Reserved);
- extern T3SQLStatistics pODBC3SQLStatistics;
- #define N3SQLStatistics(a,b,c,d,e,f,g,h,i) (*pODBC3SQLStatistics)(a,b,c,d,e,f,g,h,i)
+
+ #define N3SQLStatistics(a,b,c,d,e,f,g,h,i) (*(T3SQLStatistics)getOdbcFunction(ODBC3SQLStatistics))(a,b,c,d,e,f,g,h,i)
typedef SQLRETURN (SQL_API *T3SQLTablePrivileges) (SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -529,8 +529,8 @@ namespace connectivity
SQLSMALLINT NameLength2,
SQLCHAR * TableName,
SQLSMALLINT NameLength3);
- extern T3SQLTablePrivileges pODBC3SQLTablePrivileges;
- #define N3SQLTablePrivileges(a,b,c,d,e,f,g) (*pODBC3SQLTablePrivileges)(a,b,c,d,e,f,g)
+
+ #define N3SQLTablePrivileges(a,b,c,d,e,f,g) (*(T3SQLTablePrivileges)getOdbcFunction(ODBC3SQLTablePrivileges))(a,b,c,d,e,f,g)
typedef SQLRETURN (SQL_API *T3SQLTables) ( SQLHSTMT StatementHandle,
SQLCHAR * CatalogName,
@@ -541,45 +541,45 @@ namespace connectivity
SQLSMALLINT NameLength3,
SQLCHAR * TableType,
SQLSMALLINT NameLength4);
- extern T3SQLTables pODBC3SQLTables;
- #define N3SQLTables(a,b,c,d,e,f,g,h,i) (*pODBC3SQLTables)(a,b,c,d,e,f,g,h,i)
+
+ #define N3SQLTables(a,b,c,d,e,f,g,h,i) (*(T3SQLTables)getOdbcFunction(ODBC3SQLTables))(a,b,c,d,e,f,g,h,i)
// Terminating a statement
typedef SQLRETURN (SQL_API *T3SQLFreeStmt) ( SQLHSTMT StatementHandle,
SQLUSMALLINT Option);
- extern T3SQLFreeStmt pODBC3SQLFreeStmt;
- #define N3SQLFreeStmt(a,b) (*pODBC3SQLFreeStmt)(a,b)
+
+ #define N3SQLFreeStmt(a,b) (*(T3SQLFreeStmt)getOdbcFunction(ODBC3SQLFreeStmt))(a,b)
typedef SQLRETURN (SQL_API *T3SQLCloseCursor) (SQLHSTMT StatementHandle);
- extern T3SQLCloseCursor pODBC3SQLCloseCursor;
- #define N3SQLCloseCursor(a) (*pODBC3SQLCloseCursor)(a)
+
+ #define N3SQLCloseCursor(a) (*(T3SQLCloseCursor)getOdbcFunction(ODBC3SQLCloseCursor))(a)
typedef SQLRETURN (SQL_API *T3SQLCancel) ( SQLHSTMT StatementHandle);
- extern T3SQLCancel pODBC3SQLCancel;
- #define N3SQLCancel(a) (*pODBC3SQLCancel)(a)
+
+ #define N3SQLCancel(a) (*(T3SQLCancel)getOdbcFunction(ODBC3SQLCancel))(a)
typedef SQLRETURN (SQL_API *T3SQLEndTran) ( SQLSMALLINT HandleType,
SQLHANDLE Handle,
SQLSMALLINT CompletionType);
- extern T3SQLEndTran pODBC3SQLEndTran;
- #define N3SQLEndTran(a,b,c) (*pODBC3SQLEndTran)(a,b,c)
+
+ #define N3SQLEndTran(a,b,c) (*(T3SQLEndTran)getOdbcFunction(ODBC3SQLEndTran))(a,b,c)
// Terminating a connection
typedef SQLRETURN (SQL_API *T3SQLDisconnect) (SQLHDBC ConnectionHandle);
- extern T3SQLDisconnect pODBC3SQLDisconnect;
- #define N3SQLDisconnect(a) (*pODBC3SQLDisconnect)(a)
+
+ #define N3SQLDisconnect(a) (*(T3SQLDisconnect)getOdbcFunction(ODBC3SQLDisconnect))(a)
typedef SQLRETURN (SQL_API *T3SQLFreeHandle) (SQLSMALLINT HandleType,
SQLHANDLE Handle);
- extern T3SQLFreeHandle pODBC3SQLFreeHandle;
- #define N3SQLFreeHandle(a,b) (*pODBC3SQLFreeHandle)(a,b)
+
+ #define N3SQLFreeHandle(a,b) (*(T3SQLFreeHandle)getOdbcFunction(ODBC3SQLFreeHandle))(a,b)
typedef SQLRETURN (SQL_API *T3SQLGetCursorName) ( SQLHSTMT StatementHandle,
SQLCHAR * CursorName,
SQLSMALLINT BufferLength,
SQLSMALLINT* NameLength2);
- extern T3SQLGetCursorName pODBC3SQLGetCursorName;
- #define N3SQLGetCursorName(a,b,c,d) (*pODBC3SQLGetCursorName)(a,b,c,d)
+
+ #define N3SQLGetCursorName(a,b,c,d) (*(T3SQLGetCursorName)getOdbcFunction(ODBC3SQLGetCursorName))(a,b,c,d)
typedef SQLRETURN (SQL_API *T3SQLNativeSql) ( SQLHSTMT ConnectionHandle,
SQLCHAR * InStatementText,
@@ -587,8 +587,8 @@ namespace connectivity
SQLCHAR * OutStatementText,
SQLINTEGER BufferLength,
SQLINTEGER * TextLength2Ptr);
- extern T3SQLNativeSql pODBC3SQLNativeSql;
- #define N3SQLNativeSql(a,b,c,d,e,f) (*pODBC3SQLNativeSql)(a,b,c,d,e,f)
+
+ #define N3SQLNativeSql(a,b,c,d,e,f) (*(T3SQLNativeSql)getOdbcFunction(ODBC3SQLNativeSql))(a,b,c,d,e,f)
}
#endif // _CONNECTIVITY_ODBC_OFUNCTIONS_HXX_
diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx
index 834a47d43ee7..54534cdd05c8 100644
--- a/connectivity/source/inc/odbc/OResultSet.hxx
+++ b/connectivity/source/inc/odbc/OResultSet.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OResultSet.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:08 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -146,6 +146,7 @@ namespace connectivity
::std::vector< ::com::sun::star::uno::Any> m_aRow; // only used when SQLGetData can't be called in any order
SQLHANDLE m_aStatementHandle;
SQLHANDLE m_aConnectionHandle;
+ OStatement_Base* m_pStatement;
::com::sun::star::uno::WeakReferenceHelper m_aStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
SQLUSMALLINT* m_pRowStatusArray;
@@ -202,9 +203,13 @@ namespace connectivity
DECLARE_SERVICE_INFO();
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
OResultSet( SQLHANDLE _pStatementHandle,OStatement_Base* pStmt);
- OResultSet( SQLHANDLE _pStatementHandle,rtl_TextEncoding _nTextEncoding);
+ // OResultSet( SQLHANDLE _pStatementHandle,OStatement_Base* pStmt,rtl_TextEncoding _nTextEncoding);
~OResultSet();
+ inline void* getOdbcFunction(sal_Int32 _nIndex) const
+ {
+ return m_pStatement->getOdbcFunction(_nIndex);
+ }
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
{
diff --git a/connectivity/source/inc/odbc/OResultSetMetaData.hxx b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
index 9606505b2bbd..48e192ee83f5 100644
--- a/connectivity/source/inc/odbc/OResultSetMetaData.hxx
+++ b/connectivity/source/inc/odbc/OResultSetMetaData.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OResultSetMetaData.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2000-11-16 10:48:34 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,9 @@
#ifndef _VECTOR_
#include <vector>
#endif
+#ifndef _CONNECTIVITY_ODBC_OCONNECTION_HXX_
+#include "odbc/OConnection.hxx"
+#endif
namespace connectivity
{
@@ -88,18 +91,24 @@ namespace connectivity
{
::std::vector<sal_Int32> m_vMapping; // when not every column is needed
- SQLHANDLE m_aStatementHandle;
- sal_Int32 m_nColCount;
+ SQLHANDLE m_aStatementHandle;
+ OConnection* m_pConnection;
+ sal_Int32 m_nColCount;
::rtl::OUString getCharColAttrib(sal_Int32 column,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
sal_Int32 getNumColAttrib(sal_Int32 column,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
public:
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OResultSetMetaData( SQLHANDLE _pStmt ) : m_aStatementHandle( _pStmt ),m_nColCount(-1){}
- OResultSetMetaData( SQLHANDLE _pStmt ,const ::std::vector<sal_Int32> & _vMapping)
- : m_aStatementHandle( _pStmt ),m_vMapping(_vMapping),m_nColCount(_vMapping.size()-1){}
+ OResultSetMetaData(OConnection* _pConnection, SQLHANDLE _pStmt ) : m_pConnection(_pConnection),m_aStatementHandle( _pStmt ),m_nColCount(-1){}
+ OResultSetMetaData(OConnection* _pConnection, SQLHANDLE _pStmt ,const ::std::vector<sal_Int32> & _vMapping)
+ : m_pConnection(_pConnection),m_aStatementHandle( _pStmt ),m_vMapping(_vMapping),m_nColCount(_vMapping.size()-1){}
~OResultSetMetaData();
+
+ inline void* getOdbcFunction(sal_Int32 _nIndex) const
+ {
+ return m_pConnection->getOdbcFunction(_nIndex);
+ }
/// Avoid ambigous cast error from the compiler.
inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
{ return this; }
diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx
index 476e4c1a90d4..17a7f32a4e30 100644
--- a/connectivity/source/inc/odbc/OStatement.hxx
+++ b/connectivity/source/inc/odbc/OStatement.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OStatement.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: rt $ $Date: 2001-05-08 10:44:01 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -199,6 +199,11 @@ namespace connectivity
::cppu::OBroadcastHelper& rBHelper;
OStatement_Base(OConnection* _pConnection );
using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
+
+ inline void* getOdbcFunction(sal_Int32 _nIndex) const
+ {
+ return m_pConnection->getOdbcFunction(_nIndex);
+ }
// OComponentHelper
virtual void SAL_CALL disposing(void){OStatement_BASE::disposing();}
// XInterface
diff --git a/connectivity/source/inc/odbc/OTools.hxx b/connectivity/source/inc/odbc/OTools.hxx
index 8698c30220d3..d50700b0dd6b 100644
--- a/connectivity/source/inc/odbc/OTools.hxx
+++ b/connectivity/source/inc/odbc/OTools.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OTools.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:08 $
+ * last change: $Author: oj $ $Date: 2001-05-15 08:18:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,10 +89,66 @@
#include <rtl/textenc.h>
#endif
+#define ODBC3SQLAllocHandle 1
+#define ODBC3SQLConnect 2
+#define ODBC3SQLDriverConnect 3
+#define ODBC3SQLBrowseConnect 4
+#define ODBC3SQLDataSources 5
+#define ODBC3SQLDrivers 6
+#define ODBC3SQLGetInfo 7
+#define ODBC3SQLGetFunctions 8
+#define ODBC3SQLGetTypeInfo 9
+#define ODBC3SQLSetConnectAttr 10
+#define ODBC3SQLGetConnectAttr 11
+#define ODBC3SQLSetEnvAttr 12
+#define ODBC3SQLGetEnvAttr 13
+#define ODBC3SQLSetStmtAttr 14
+#define ODBC3SQLGetStmtAttr 15
+#define ODBC3SQLPrepare 16
+#define ODBC3SQLBindParameter 17
+#define ODBC3SQLSetCursorName 18
+#define ODBC3SQLExecute 19
+#define ODBC3SQLExecDirect 20
+#define ODBC3SQLDescribeParam 21
+#define ODBC3SQLNumParams 22
+#define ODBC3SQLParamData 23
+#define ODBC3SQLPutData 24
+#define ODBC3SQLRowCount 25
+#define ODBC3SQLNumResultCols 26
+#define ODBC3SQLDescribeCol 27
+#define ODBC3SQLColAttribute 28
+#define ODBC3SQLBindCol 29
+#define ODBC3SQLFetch 30
+#define ODBC3SQLFetchScroll 31
+#define ODBC3SQLGetData 32
+#define ODBC3SQLSetPos 33
+#define ODBC3SQLBulkOperations 34
+#define ODBC3SQLMoreResults 35
+#define ODBC3SQLGetDiagRec 36
+#define ODBC3SQLColumnPrivileges 37
+#define ODBC3SQLColumns 38
+#define ODBC3SQLForeignKeys 39
+#define ODBC3SQLPrimaryKeys 40
+#define ODBC3SQLProcedureColumns 41
+#define ODBC3SQLProcedures 42
+#define ODBC3SQLSpecialColumns 43
+#define ODBC3SQLStatistics 44
+#define ODBC3SQLTablePrivileges 45
+#define ODBC3SQLTables 46
+#define ODBC3SQLFreeStmt 47
+#define ODBC3SQLCloseCursor 48
+#define ODBC3SQLCancel 49
+#define ODBC3SQLEndTran 50
+#define ODBC3SQLDisconnect 51
+#define ODBC3SQLFreeHandle 52
+#define ODBC3SQLGetCursorName 53
+#define ODBC3SQLNativeSql 54
+
namespace connectivity
{
namespace odbc
{
+ class OConnection;
const sal_uInt32 ODBC_FRACTION_UNITS_PER_HSECOND = 10000000L;
const sal_Int32 MAX_PUT_DATA_LENGTH = 2000;
@@ -100,18 +156,35 @@ namespace connectivity
class OTools
{
public:
- static void ThrowException( SQLRETURN _rRetCode,SQLHANDLE _pContext,SQLSMALLINT _nHandleType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,sal_Bool _bNoFound=sal_True,
+ static void ThrowException( OConnection* _pConnection,
+ SQLRETURN _rRetCode,
+ SQLHANDLE _pContext,
+ SQLSMALLINT _nHandleType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ sal_Bool _bNoFound=sal_True,
rtl_TextEncoding _nTextEncoding = RTL_TEXTENCODING_MS_1252)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ throw(::com::sun::star::sdbc::SQLException);
+
+ static void GetInfo(OConnection* _pConnection,
+ SQLHANDLE _aConnectionHandle,
+ SQLUSMALLINT _nInfo,
+ ::rtl::OUString &_rValue,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding)
+ throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ static void GetInfo(OConnection* _pConnection,
+ SQLHANDLE _aConnectionHandle,
+ SQLUSMALLINT _nInfo,
+ sal_Int32 &_rValue,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static void GetInfo(SQLHANDLE _aConnectionHandle,SQLUSMALLINT _nInfo,::rtl::OUString &_rValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ static void GetInfo(OConnection* _pConnection,
+ SQLHANDLE _aConnectionHandle,
+ SQLUSMALLINT _nInfo,
+ sal_Bool &_rValue,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static void GetInfo(SQLHANDLE _aConnectionHandle,SQLUSMALLINT _nInfo,sal_Int32 &_rValue,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static void GetInfo(SQLHANDLE _aConnectionHandle,SQLUSMALLINT _nInfo,sal_Bool &_rValue,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
static sal_Int32 MapOdbcType2Jdbc(sal_Int32 _nType);
static sal_Int32 jdbcTypeToOdbc(sal_Int32 jdbcType);
@@ -146,58 +219,72 @@ namespace connectivity
static void getBindTypes(sal_Bool _bUseWChar,sal_Bool _bUseOldTimeDate,
sal_Int32 jdbcType,SQLSMALLINT& fCType,SQLSMALLINT& fSqlType,
SQLUINTEGER& nColumnSize,SQLSMALLINT& nDecimalDigits);
- static ::rtl::OUString getStringValue(SQLHANDLE _aStatementHandle,sal_Int32 columnIndex,SWORD _fSqlType,sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- static ::com::sun::star::uno::Sequence<sal_Int8> OTools::getBytesValue(SQLHANDLE _aStatementHandle,sal_Int32 columnIndex,SWORD _fSqlType,sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static void getValue( SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- void* _pValue,
- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ static ::rtl::OUString getStringValue( OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SWORD _fSqlType,
+ sal_Bool &_bWasNull,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence<sal_Int8> getBytesValue(OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SWORD _fSqlType,
+ sal_Bool &_bWasNull,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ static void getValue( OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SQLSMALLINT _nType,
+ sal_Bool &_bWasNull,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ void* _pValue,
+ SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
static void bindData( SWORD fSqlType,
- sal_Bool _bUseWChar,
- void *&_pData,
- SDWORD*& pLen,
- const void* _pValue,
- rtl_TextEncoding _nTextEncoding);
-
- static void bindParameter(SQLHANDLE _hStmt,
- sal_Int32 nPos,
- sal_Int8* pDataBuffer,
- sal_Int8* pLenBuffer,
- SQLSMALLINT _nJDBCtype,
- sal_Bool _bUseWChar,
- sal_Bool _bUseOldTimeDate,
- const void* _pValue,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- static void bindValue( SQLHANDLE _aStatementHandle,
+ sal_Bool _bUseWChar,
+ void *&_pData,
+ SDWORD*& pLen,
+ const void* _pValue,
+ rtl_TextEncoding _nTextEncoding);
+
+ static void bindParameter( OConnection* _pConnection,
+ SQLHANDLE _hStmt,
+ sal_Int32 nPos,
+ sal_Int8* pDataBuffer,
+ sal_Int8* pLenBuffer,
+ SQLSMALLINT _nJDBCtype,
+ sal_Bool _bUseWChar,
+ sal_Bool _bUseOldTimeDate,
+ const void* _pValue,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding)
+ throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ static void bindValue( OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
+ sal_Int32 columnIndex,
+ SQLSMALLINT _nType,
+ SQLSMALLINT _nMaxLen,
+ SQLSMALLINT _nScale,
+ const void* _pValue,
+ void* _pData,
+ SQLINTEGER *pLen,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
+ rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ };
+
+ template <class T> void getValue( OConnection* _pConnection,
+ SQLHANDLE _aStatementHandle,
sal_Int32 columnIndex,
SQLSMALLINT _nType,
- SQLSMALLINT _nMaxLen,
- SQLSMALLINT _nScale,
- const void* _pValue,
- void* _pData,
- SQLINTEGER *pLen,
+ sal_Bool &_bWasNull,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- };
-
- template <class T> void getValue( SQLHANDLE _aStatementHandle,
- sal_Int32 columnIndex,
- SQLSMALLINT _nType,
- sal_Bool &_bWasNull,
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
- T& _rValue) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
+ T& _rValue) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
- OTools::getValue(_aStatementHandle,columnIndex,_nType,_bWasNull,_xInterface,&_rValue,sizeof _rValue);
+ OTools::getValue(_pConnection,_aStatementHandle,columnIndex,_nType,_bWasNull,_xInterface,&_rValue,sizeof _rValue);
}
//-----------------------------------------------------------------------------