User: rt      
Date: 2008-01-29 13:55:00+0000
Modified:
   dba/connectivity/source/drivers/odbc/OResultSetMetaData.cxx

Log:
 INTEGRATION: CWS reportdesign02 (1.19.150); FILE MERGED
 2007/10/26 12:02:53 oj 1.19.150.1: #i61881# use odbc type instead of jdbc type

File Changes:

Directory: /dba/connectivity/source/drivers/odbc/
=================================================

File [changed]: OResultSetMetaData.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/odbc/OResultSetMetaData.cxx?r1=1.19&r2=1.20
Delta lines:  +38 -10
---------------------
--- OResultSetMetaData.cxx      2006-09-17 03:07:27+0000        1.19
+++ OResultSetMetaData.cxx      2008-01-29 13:54:57+0000        1.20
@@ -95,21 +95,30 @@
        return  sValue;
 }
 // -------------------------------------------------------------------------
+SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection
+                                              ,SQLHANDLE _aStatementHandle
+                                              ,const 
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& 
_xInterface
+                                              ,sal_Int32 _column
+                                              ,sal_Int32 _ident) 
throw(SQLException, RuntimeException)
+{
+       SWORD nValue=0;
+       
OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle,
+                                                                               
 (SQLUSMALLINT)_column,
+                                                                               
 (SQLUSMALLINT)_ident,
+                                                                               
 NULL,
+                                                                               
 0,
+                                                                               
 NULL,
+                                                                               
 &nValue),_aStatementHandle,SQL_HANDLE_STMT,_xInterface);
+       return nValue;
+}
+// -------------------------------------------------------------------------
 sal_Int32 OResultSetMetaData::getNumColAttrib(sal_Int32 _column,sal_Int32 
ident) throw(SQLException, RuntimeException)
 {
        sal_Int32 column = _column;
        if(_column < (sal_Int32)m_vMapping.size()) // use mapping
                column = m_vMapping[_column];
 
-       sal_Int32 nValue=0;
-       
OTools::ThrowException(m_pConnection,N3SQLColAttribute(m_aStatementHandle,
-                                                                               
 (SQLUSMALLINT)column,
-                                                                               
 (SQLUSMALLINT)ident,
-                                                                               
 NULL,
-                                                                               
 0,
-                                                                               
 NULL,
-                                                                               
 &nValue),m_aStatementHandle,SQL_HANDLE_STMT,*this);
-       return nValue;
+    return 
getNumColAttrib(m_pConnection,m_aStatementHandle,*this,column,ident);
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column 
) throw(SQLException, RuntimeException)
@@ -117,7 +126,26 @@
        return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE);
 }
 // -------------------------------------------------------------------------
-
+SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection
+                                              ,SQLHANDLE _aStatementHandle
+                                              ,const 
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& 
_xInterface
+                                              ,sal_Int32 column)
+                                               
throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException)
+{
+    SWORD nType = 0;
+    try
+       {
+               nType = 
getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE);
+               if(nType == SQL_UNKNOWN_TYPE)
+                       nType = 
getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column, 
SQL_DESC_TYPE);
+       }
+       catch(SQLException& ) // in this case we have an odbc 2.0 driver
+       {
+               nType = 
getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE
 );
+       }
+    return nType;
+}
+// 
-----------------------------------------------------------------------------
 sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) 
throw(SQLException, RuntimeException)
 {
        sal_Int32 nType = 0;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to