diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-05-14 10:42:44 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-05-14 10:42:44 +0000 |
commit | 0abbd65247f1527153ca8692d453bca72052a023 (patch) | |
tree | 872cdbeaef351a83688e06008c128a145ec119cd /connectivity/source/drivers/file | |
parent | 3111f05ead7ee44b051faeb245e6538a9a796dd2 (diff) |
#86528# lower size need
Diffstat (limited to 'connectivity/source/drivers/file')
-rw-r--r-- | connectivity/source/drivers/file/FPreparedStatement.cxx | 55 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FResultSetMetaData.cxx | 87 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 31 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcomp.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/drivers/file/makefile.mk | 51 |
5 files changed, 138 insertions, 100 deletions
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 21986788cf51..689fac8db68b 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FPreparedStatement.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:27 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,10 +73,6 @@ #ifndef _CONNECTIVITY_FILE_ORESULTSETMETADATA_HXX_ #include "file/FResultSetMetaData.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE file -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> #endif @@ -92,6 +88,9 @@ #ifndef _DBHELPER_DBCONVERSION_HXX_ #include "connectivity/dbconversion.hxx" #endif +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" +#endif using namespace connectivity; @@ -237,7 +236,7 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::r throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(x); else @@ -272,7 +271,7 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(x); @@ -286,7 +285,7 @@ void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back((sal_Int32)x); @@ -301,7 +300,7 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(DBTypeConversion::toDouble(aData)); @@ -317,7 +316,7 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(DBTypeConversion::toDouble(aVal)); @@ -332,7 +331,7 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(DBTypeConversion::toDouble(aVal)); @@ -347,7 +346,7 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(x); @@ -363,7 +362,7 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back((double)x); @@ -378,7 +377,7 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(x); @@ -392,7 +391,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 a ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -403,7 +402,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s throw DisposedException(); // Get the buffer needed for the length if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(ORowSetValue()); @@ -417,7 +416,7 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -426,7 +425,7 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -435,7 +434,7 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -444,7 +443,7 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -454,7 +453,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); // For each known SQL Type, call the appropriate // set routine @@ -518,7 +517,7 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); if(parameterIndex >= (sal_Int32)m_aRow->size()) m_aRow->push_back(ORowSetValue()); @@ -532,7 +531,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); // setObject (parameterIndex, x, sqlType, 0); } // ------------------------------------------------------------------------- @@ -543,7 +542,7 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); if( parameterIndex < 1) - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); setInt(parameterIndex,x); } // ------------------------------------------------------------------------- @@ -553,7 +552,7 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -563,7 +562,7 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- @@ -572,7 +571,7 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con ::osl::MutexGuard aGuard( m_aMutex ); if (OStatement_BASE::rBHelper.bDisposed) throw DisposedException(); - throw SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,Any()); + throwInvalidIndexException(*this); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/file/FResultSetMetaData.cxx b/connectivity/source/drivers/file/FResultSetMetaData.cxx index bdebb0708f27..e55c9ea88073 100644 --- a/connectivity/source/drivers/file/FResultSetMetaData.cxx +++ b/connectivity/source/drivers/file/FResultSetMetaData.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FResultSetMetaData.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-05-02 12:54:56 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,17 +62,18 @@ #ifndef _CONNECTIVITY_FILE_ORESULTSETMETADATA_HXX_ #include "file/FResultSetMetaData.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE file -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _CONNECTIVITY_FILE_TABLE_HXX_ #include "file/FTable.hxx" #endif #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" +#endif + using namespace connectivity; +using namespace dbtools; using namespace connectivity::file; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; @@ -99,18 +100,18 @@ OResultSetMetaData::~OResultSetMetaData() sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)(sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); - return getINT32((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_PRECISION)); + return getINT32((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)(sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); - return getINT32((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_TYPE)); + return getINT32((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))); } // ------------------------------------------------------------------------- @@ -123,7 +124,7 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, Ru sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)(sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return sal_False; } @@ -132,7 +133,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw( ::rtl::OUString SAL_CALL OResultSetMetaData::getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)(sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return ::rtl::OUString(); } @@ -141,16 +142,16 @@ sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw( ::rtl::OUString SAL_CALL OResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); - Any aName((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_NAME)); - return aName.hasValue() ? getString(aName) : getString((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_NAME)); + Any aName((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))); + return aName.hasValue() ? getString(aName) : getString((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))); } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return m_aTableName; } @@ -158,28 +159,28 @@ sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw( ::rtl::OUString SAL_CALL OResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return ::rtl::OUString(); } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getString((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_TYPENAME)); + throwInvalidIndexException(*this); + return getString((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))); } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getString((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_NAME)); + throwInvalidIndexException(*this); + return getString((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))); } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return ::rtl::OUString(); } // ------------------------------------------------------------------------- @@ -187,52 +188,52 @@ sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw( sal_Bool SAL_CALL OResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getBOOL((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_ISCURRENCY)); + throwInvalidIndexException(*this); + return getBOOL((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY))); } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getBOOL((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_ISAUTOINCREMENT)); + throwInvalidIndexException(*this); + return getBOOL((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))); } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return sal_False; } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL OResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getINT32((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_PRECISION)); + throwInvalidIndexException(*this); + return getINT32((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getINT32((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_SCALE)); + throwInvalidIndexException(*this); + return getINT32((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL OResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - return getINT32((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_ISNULLABLE)); + throwInvalidIndexException(*this); + return getINT32((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))); } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); + throwInvalidIndexException(*this); return sal_True; } // ------------------------------------------------------------------------- @@ -240,9 +241,9 @@ sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQL sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - if((*m_xColumns)[column-1]->getPropertySetInfo()->hasPropertyByName(PROPERTY_FUNCTION) && - ::cppu::any2bool((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_FUNCTION))) + throwInvalidIndexException(*this); + if((*m_xColumns)[column-1]->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)) && + ::cppu::any2bool((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)))) return sal_True; return m_pTable->isReadOnly(); } @@ -251,9 +252,9 @@ sal_Bool SAL_CALL OResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLEx sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - if((*m_xColumns)[column-1]->getPropertySetInfo()->hasPropertyByName(PROPERTY_FUNCTION) && - ::cppu::any2bool((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_FUNCTION))) + throwInvalidIndexException(*this); + if((*m_xColumns)[column-1]->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)) && + ::cppu::any2bool((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)))) return sal_False; return !m_pTable->isReadOnly(); ; @@ -262,9 +263,9 @@ sal_Bool SAL_CALL OResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) t sal_Bool SAL_CALL OResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException) { if(column <= 0 || column > (sal_Int32)m_xColumns->size()) - throw ::com::sun::star::sdbc::SQLException(STAT_INVALID_INDEX,*this,::rtl::OUString::createFromAscii("07009"),0,::com::sun::star::uno::Any()); - if((*m_xColumns)[column-1]->getPropertySetInfo()->hasPropertyByName(PROPERTY_FUNCTION) && - ::cppu::any2bool((*m_xColumns)[column-1]->getPropertyValue(PROPERTY_FUNCTION))) + throwInvalidIndexException(*this); + if((*m_xColumns)[column-1]->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)) && + ::cppu::any2bool((*m_xColumns)[column-1]->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FUNCTION)))) return sal_False; return !m_pTable->isReadOnly(); } diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index aea96f370917..3f4b3e4e6b5c 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FStatement.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:27 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,10 +74,6 @@ #ifndef _CONNECTIVITY_FILE_ORESULTSET_HXX_ #include "file/FResultSet.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE file -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _COMPHELPER_PROPERTY_HXX_ #include <comphelper/property.hxx> #endif @@ -114,11 +110,6 @@ namespace connectivity { namespace file { -// define the properties of this lib -// this file includes the properties for this dll -#ifndef CONNECTIVITY_USTRINGDESCRIPTION_IMPL_HXX -#include "UStringDescription_Impl.hxx" -#endif //------------------------------------------------------------------------------ using namespace com::sun::star::uno; @@ -147,16 +138,16 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE( sal_Int32 nAttrib = 0; - registerProperty(PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, nAttrib,&m_aCursorName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); - registerProperty(PROPERTY_MAXFIELDSIZE, PROPERTY_ID_MAXFIELDSIZE, nAttrib,&m_nMaxFieldSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); - registerProperty(PROPERTY_MAXROWS, PROPERTY_ID_MAXROWS, nAttrib,&m_nMaxRows, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); - registerProperty(PROPERTY_QUERYTIMEOUT, PROPERTY_ID_QUERYTIMEOUT, nAttrib,&m_nQueryTimeOut, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); - registerProperty(PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, nAttrib,&m_nFetchSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); - registerProperty(PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, nAttrib,&m_nResultSetType, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); - registerProperty(PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, nAttrib,&m_nFetchDirection, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); - registerProperty(PROPERTY_ESCAPEPROCESSING, PROPERTY_ID_ESCAPEPROCESSING, nAttrib,&m_bEscapeProcessing,::getCppuBooleanType()); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME), PROPERTY_ID_CURSORNAME, nAttrib,&m_aCursorName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXFIELDSIZE), PROPERTY_ID_MAXFIELDSIZE, nAttrib,&m_nMaxFieldSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXROWS), PROPERTY_ID_MAXROWS, nAttrib,&m_nMaxRows, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_QUERYTIMEOUT), PROPERTY_ID_QUERYTIMEOUT, nAttrib,&m_nQueryTimeOut, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE), PROPERTY_ID_FETCHSIZE, nAttrib,&m_nFetchSize, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE), PROPERTY_ID_RESULTSETTYPE, nAttrib,&m_nResultSetType, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION), PROPERTY_ID_FETCHDIRECTION, nAttrib,&m_nFetchDirection, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ESCAPEPROCESSING), PROPERTY_ID_ESCAPEPROCESSING, nAttrib,&m_bEscapeProcessing,::getCppuBooleanType()); - registerProperty(PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, nAttrib,&m_nResultSetConcurrency, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY), PROPERTY_ID_RESULTSETCONCURRENCY, nAttrib,&m_nResultSetConcurrency, ::getCppuType(reinterpret_cast<sal_Int32*>(NULL))); } //------------------------------------------------------------------------------ void OStatement_Base::disposeResultSet() diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index 6dcb96c7dfbf..4d5731762a88 100644 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fcomp.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2001-05-07 10:37:52 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,6 +65,10 @@ #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" +#endif + #ifndef _CONNECTIVITY_SQLPARSE_HXX #include "connectivity/sqlparse.hxx" #endif @@ -77,10 +81,6 @@ #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include "connectivity/dbexception.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE file -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif using namespace connectivity; using namespace connectivity::file; @@ -461,7 +461,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode* pPredicateNode) thr { ::rtl::OUString sMsg = ::rtl::OUString::createFromAscii("Column not found: "); sMsg += aColumnName; - throw SQLException(sMsg,NULL,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(sMsg,NULL,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xCol; try diff --git a/connectivity/source/drivers/file/makefile.mk b/connectivity/source/drivers/file/makefile.mk index b6afa45d0285..49b80c4af232 100644 --- a/connectivity/source/drivers/file/makefile.mk +++ b/connectivity/source/drivers/file/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: oj $ $Date: 2001-03-28 11:31:44 $ +# last change: $Author: oj $ $Date: 2001-05-14 11:37:36 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -65,7 +65,10 @@ PRJINC=..$/.. PRJNAME=connectivity TARGET=file +USE_LDUMP2=TRUE +USE_DEFFILE=TRUE ENABLE_EXCEPTIONS=TRUE +LDUMP=ldump2.exe # --- Settings ---------------------------------- .IF "$(DBGUTIL_OJ)"!="" @@ -93,8 +96,52 @@ SLOFILES=\ $(SLO)$/fcode.obj \ $(SLO)$/fcomp.obj +.IF "$(OS)"=="MACOSX" +#SHL1VERSIONMAP=$(TARGET).$(DLLPOSTFIX).map +.ELSE +SHL1VERSIONMAP=$(TARGET).map +.ENDIF +# --- Library ----------------------------------- +SHL1TARGET=$(TARGET)$(UPD)$(DLLPOSTFIX) +SHL1OBJS=$(SLOFILES) +SHL1STDLIBS=\ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(VOSLIB) \ + $(OSLLIB) \ + $(SVLLIB) \ + $(SVLIB) \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(UCBHELPERLIB) \ + $(SALLIB) \ + $(DBTOOLSLIB) \ + $(UNOTOOLSLIB) \ + $(COMPHELPERLIB) + +SHL1DEPN= +SHL1IMPLIB= i$(TARGET)$(UPD) + +SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +DEF1NAME= $(SHL1TARGET) +DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \ + $(SLB)$/$(TARGET).lib +DEFLIB1NAME=$(TARGET) + # --- Targets ---------------------------------- .INCLUDE : target.mk +# --- filter file ------------------------------ + +.IF "$(depend)"=="" + +$(MISC)$/$(SHL1TARGET).flt: makefile.mk + @echo ------------------------------ + @echo CLEAR_THE_FILE > $@ + @echo _TI >>$@ + @echo _real >>$@ +.ENDIF + |