diff options
Diffstat (limited to 'connectivity/source/drivers/ado')
-rw-r--r-- | connectivity/source/drivers/ado/AResultSet.cxx | 24 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/Aolevariant.cxx | 93 | ||||
-rwxr-xr-x | connectivity/source/drivers/ado/ado.xcu | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/adoimp.cxx | 2 |
4 files changed, 115 insertions, 9 deletions
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx index 1c53614bba04..438f3bc473cc 100644 --- a/connectivity/source/drivers/ado/AResultSet.cxx +++ b/connectivity/source/drivers/ado/AResultSet.cxx @@ -334,11 +334,9 @@ Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 /*columnIndex*/ ) throw } // ------------------------------------------------------------------------- -Any SAL_CALL OResultSet::getObject( sal_Int32 /*columnIndex*/, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) +Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) { - - ::dbtools::throwFeatureNotImplementedException( "XRow::getObject", *this ); - return Any(); + return getValue(columnIndex).makeAny(); } // ------------------------------------------------------------------------- @@ -786,14 +784,24 @@ void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const ::com::s } // ------------------------------------------------------------------------- -void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 /*columnIndex*/, const Reference< ::com::sun::star::io::XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException) +void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { - ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateBinaryStream", *this ); + if(!x.is()) + ::dbtools::throwFunctionSequenceException(*this); + + Sequence<sal_Int8> aSeq; + x->readBytes(aSeq,length); + updateBytes(columnIndex,aSeq); } // ------------------------------------------------------------------------- -void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 /*columnIndex*/, const Reference< ::com::sun::star::io::XInputStream >& /*x*/, sal_Int32 /*length*/ ) throw(SQLException, RuntimeException) +void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { - ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateCharacterStream", *this ); + if(!x.is()) + ::dbtools::throwFunctionSequenceException(*this); + + Sequence<sal_Int8> aSeq; + x->readBytes(aSeq,length); + updateBytes(columnIndex,aSeq); } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException) diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx index 09596da61bd6..b1b8235da3d8 100644 --- a/connectivity/source/drivers/ado/Aolevariant.cxx +++ b/connectivity/source/drivers/ado/Aolevariant.cxx @@ -39,8 +39,17 @@ #include "diagnose_ex.h" #include "resource/sharedresources.hxx" #include "resource/ado_res.hrc" - +#include "com/sun/star/bridge/oleautomation/Date.hpp" +#include "com/sun/star/bridge/oleautomation/Currency.hpp" +#include "com/sun/star/bridge/oleautomation/SCode.hpp" +#include "com/sun/star/bridge/oleautomation/Decimal.hpp" + +using namespace com::sun::star::beans; +using namespace com::sun::star::uno; +using namespace com::sun::star::bridge::oleautomation; using namespace connectivity::ado; +using ::rtl::OUString; + OLEString::OLEString() :m_sStr(NULL) { @@ -698,6 +707,88 @@ SAFEARRAY* OLEVariant::getUI1SAFEARRAYPtr() const return V_ARRAY(&varDest); } // ----------------------------------------------------------------------------- +::com::sun::star::uno::Any OLEVariant::makeAny() const +{ + ::com::sun::star::uno::Any aValue; + switch (V_VT(this)) + { + case VT_EMPTY: + case VT_NULL: + aValue.setValue(NULL, Type()); + break; + case VT_I2: + aValue.setValue( & iVal, getCppuType( (sal_Int16*)0)); + break; + case VT_I4: + aValue.setValue( & lVal, getCppuType( (sal_Int32*)0)); + break; + case VT_R4: + aValue.setValue( & fltVal, getCppuType( (float*)0)); + break; + case VT_R8: + aValue.setValue(& dblVal, getCppuType( (double*)0)); + break; + case VT_CY: + { + Currency cy(cyVal.int64); + aValue <<= cy; + break; + } + case VT_DATE: + { + aValue <<= (::com::sun::star::util::Date)*this; + break; + } + case VT_BSTR: + { + OUString b(reinterpret_cast<const sal_Unicode*>(bstrVal)); + aValue.setValue( &b, getCppuType( &b)); + break; + } + case VT_BOOL: + { + sal_Bool b= boolVal == VARIANT_TRUE; + aValue.setValue( &b, getCppuType( &b)); + break; + } + case VT_I1: + aValue.setValue( & cVal, getCppuType((sal_Int8*)0)); + break; + case VT_UI1: // there is no unsigned char in UNO + aValue.setValue( & bVal, getCppuType( (sal_Int8*)0)); + break; + case VT_UI2: + aValue.setValue( & uiVal, getCppuType( (sal_uInt16*)0)); + break; + case VT_UI4: + aValue.setValue( & ulVal, getCppuType( (sal_uInt32*)0)); + break; + case VT_INT: + aValue.setValue( & intVal, getCppuType( (sal_Int32*)0)); + break; + case VT_UINT: + aValue.setValue( & uintVal, getCppuType( (sal_uInt32*)0)); + break; + case VT_VOID: + aValue.setValue( NULL, Type()); + break; + case VT_DECIMAL: + { + Decimal dec; + dec.Scale = decVal.scale; + dec.Sign = decVal.sign; + dec.LowValue = decVal.Lo32; + dec.MiddleValue = decVal.Mid32; + dec.HighValue = decVal.Hi32; + aValue <<= dec; + break; + } + + default: + break; + } + return aValue; +} // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu index 236d38bd7ff7..8a106c70283f 100755 --- a/connectivity/source/drivers/ado/ado.xcu +++ b/connectivity/source/drivers/ado/ado.xcu @@ -115,6 +115,11 @@ <value>true</value> </prop> </node> + <node oor:name="PrimaryKeySupport" oor:op="replace"> + <prop oor:name="Value" oor:type="xs:boolean"> + <value>true</value> + </prop> + </node> </node> <node oor:name="MetaData"> <node oor:name="SupportsTableCreation" oor:op="replace"> diff --git a/connectivity/source/drivers/ado/adoimp.cxx b/connectivity/source/drivers/ado/adoimp.cxx index 188303a1ba50..e3412babfdf6 100644 --- a/connectivity/source/drivers/ado/adoimp.cxx +++ b/connectivity/source/drivers/ado/adoimp.cxx @@ -157,8 +157,10 @@ DataTypeEnum ADOS::MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine) case DataType::BIT: return adBoolean; break; case DataType::BINARY: return adBinary; break; case DataType::VARCHAR: return adVarWChar; break; + case DataType::CLOB: case DataType::LONGVARCHAR: return adLongVarWChar; break; case DataType::VARBINARY: return adVarBinary; break; + case DataType::BLOB: case DataType::LONGVARBINARY: return adLongVarBinary; break; case DataType::CHAR: return adWChar; break; case DataType::TINYINT: return isJetEngine(_nJetEngine) ? adUnsignedTinyInt : adTinyInt;break; |