summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2010-01-08 09:22:30 +0000
committerOliver Bolte <obo@openoffice.org>2010-01-08 09:22:30 +0000
commit6f43b973e70a27ae33f42ed846d4aa0cea323a29 (patch)
tree191e8dbe4f238c9d59c41b48e142ad39ee31c639
parent97463bc311d99f3a70431e7858ec8be43b0c21b2 (diff)
CWS-TOOLING: integrate CWS dba32k
2010-01-07 10:56:59 +0100 fs r277873 : #i108123# getDataSourcePrefixFromMediaType: care for types where the config says 'no extension', but the actual file contains an extension 2010-01-05 18:11:23 +0100 pl r277862 : #i108068# always release solar mutex before calling into UNO 2010-01-05 12:47:51 +0100 oj r277856 : #i107793# set props in endDoc 2010-01-05 09:59:29 +0100 fs r277852 : #i10000# 2010-01-05 08:51:21 +0100 oj r277851 : #i107794# fix for WChar 2010-01-04 14:58:14 +0100 fs r277849 : #i108019# 2010-01-04 14:57:49 +0100 fs r277848 : #i108040# 2010-01-04 13:56:14 +0100 fs r277843 : #i107917# do not access xDataSource for reading, but use getDataSource() 2010-01-04 12:08:25 +0100 fs r277841 : #i107845# when composing the new filter, *first* use the old filter, then the new one - order matters 2010-01-04 11:57:05 +0100 fs r277840 : manual CWS creation: create CWS dba32k from OOO320_m8 tag
-rw-r--r--connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx16
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx1
2 files changed, 12 insertions, 5 deletions
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index 773b9c0293..20e705ba0e 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -283,7 +283,7 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
aDate.day = 0;
aDate.month = 0;
aDate.year = 0;
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_DATE : SQL_C_TYPE_DATE,m_bWasNull,**this,&aDate,sizeof aDate);
return Date(aDate.day,aDate.month,aDate.year);
}
else
@@ -434,7 +434,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
::rtl::OUString aVal;
if(columnIndex <= m_nDriverColumnCount)
- aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,(SWORD)SQL_C_WCHAR,m_bWasNull,**this,m_nTextEncoding);
+ aVal = OTools::getStringValue(m_pConnection,m_aStatementHandle,columnIndex,impl_getColumnType_nothrow(columnIndex),m_bWasNull,**this,m_nTextEncoding);
else
m_bWasNull = sal_True;
@@ -454,7 +454,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
TIME_STRUCT aTime={0,0,0};
if(columnIndex <= m_nDriverColumnCount)
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIME : SQL_C_TYPE_TIME,m_bWasNull,**this,&aTime,sizeof aTime);
else
m_bWasNull = sal_True;
return Time(0,aTime.second,aTime.minute,aTime.hour);
@@ -472,7 +472,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
columnIndex = mapColumn(columnIndex);
TIMESTAMP_STRUCT aTime={0,0,0,0,0,0,0};
if(columnIndex <= m_nDriverColumnCount)
- OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,SQL_C_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
+ OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIMESTAMP : SQL_C_TYPE_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
else
m_bWasNull = sal_True;
return DateTime((sal_uInt16)aTime.fraction*1000,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
@@ -1316,5 +1316,11 @@ void ODatabaseMetaDataResultSet::checkColumnCount()
}
// -----------------------------------------------------------------------------
-
+SWORD ODatabaseMetaDataResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex)
+{
+ ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
+ if ( aFind == m_aODBCColumnTypes.end() )
+ aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pConnection,m_aStatementHandle,*this,columnIndex))).first;
+ return aFind->second;
+}
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index 5078eb3ac5..d0134d542d 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -100,6 +100,7 @@ namespace connectivity
sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ SWORD impl_getColumnType_nothrow(sal_Int32 column);
sal_Int32 mapColumn (sal_Int32 column);