User: obo Date: 2006/07/10 07:16:29 Modified: dba/connectivity/inc/connectivity/dbtools.hxx
Log: INTEGRATION: CWS qiq (1.29.96); FILE MERGED 2006/06/27 13:51:59 fs 1.29.96.4: RESYNC: (1.29-1.30); FILE MERGED 2006/06/01 09:41:57 fs 1.29.96.3: #i51143# export isValidSQLName 2006/05/23 13:02:10 fs 1.29.96.2: some refactoring of compose/quoteTableName and friends, in preparation of #i51143# 2006/05/11 10:30:54 fs 1.29.96.1: #i51143# +prependErrorInfo File Changes: Directory: /dba/connectivity/inc/connectivity/ ============================================== File [changed]: dbtools.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/dbtools.hxx?r1=1.30&r2=1.31 Delta lines: +53 -17 --------------------- --- dbtools.hxx 20 Jun 2006 01:00:11 -0000 1.30 +++ dbtools.hxx 10 Jul 2006 14:16:27 -0000 1.31 @@ -106,7 +106,8 @@ eInIndexDefinitions, eInDataManipulation, eInProcedureCalls, - eInPrivilegeDefinitions + eInPrivilegeDefinitions, + eComplete }; //========================================================================= // date conversion @@ -321,7 +322,14 @@ /** create a new ::com::sun::star::sdbc::SQLContext, fill it with the given descriptions and the given source, and <i>append</i> _rException (i.e. put it into the NextException member of the SQLContext). */ - ::com::sun::star::sdb::SQLContext prependContextInfo(const ::com::sun::star::sdbc::SQLException& _rException, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, const ::rtl::OUString& _rContextDescription, const ::rtl::OUString& _rContextDetails = ::rtl::OUString()); + ::com::sun::star::sdb::SQLContext prependContextInfo(const ::com::sun::star::sdbc::SQLException& _rException, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, const ::rtl::OUString& _rContextDescription, const ::rtl::OUString& _rContextDetails ); + + ::com::sun::star::sdbc::SQLException prependErrorInfo( + const ::com::sun::star::sdbc::SQLException& _rChainedException, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, + const ::rtl::OUString& _rAdditionalError, + const StandardSQLState _eSQLState = SQL_ERROR_UNSPECIFIED, + const sal_Int32 _nErrorCode = 0); /** search the parent hierachy for a data source. */ @@ -349,9 +357,7 @@ */ ::rtl::OUString quoteTableName(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _rxMeta , const ::rtl::OUString& _rName - ,EComposeRule _eComposeRule - ,sal_Bool _bUseCatalogInSelect = sal_True - ,sal_Bool _bUseSchemaInSelect = sal_True); + ,EComposeRule _eComposeRule); /** split a fully qualified table name (including catalog and schema, if appliable) into it's component parts. @param _rxConnMetaData meta data describing the connection where you got the table name from @@ -441,16 +447,34 @@ //---------------------------------------------------------------------------------- /** compose a complete table name from it's up to three parts, regarding to the database meta data composing rules */ - void composeTableName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMetaData, + ::rtl::OUString composeTableName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMetaData, const ::rtl::OUString& _rCatalog, const ::rtl::OUString& _rSchema, const ::rtl::OUString& _rName, - ::rtl::OUString& _rComposedName, sal_Bool _bQuote, - EComposeRule _eComposeRule - ,sal_Bool _bUseCatalogInSelect = sal_True - ,sal_Bool _bUseSchemaInSelect = sal_True); + EComposeRule _eComposeRule); + + /** composes a table name for usage in a SELECT statement + This includes quoting of the table as indicated by the connection's meta data, plus respecting + the settings "UseCatalogInSelect" and "UseSchemaInSelect", which might be present + in the data source which the connection belongs to. + */ + ::rtl::OUString composeTableNameForSelect( + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, + const ::rtl::OUString& _rCatalog, + const ::rtl::OUString& _rSchema, + const ::rtl::OUString& _rName ); + + /** composes a table name for usage in a SELECT statement + + This includes quoting of the table as indicated by the connection's meta data, plus respecting + the settings "UseCatalogInSelect" and "UseSchemaInSelect", which might be present + in the data source which the connection belongs to. + */ + ::rtl::OUString composeTableNameForSelect( + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable ); //---------------------------------------------------------------------------------- /** compose the table name out of the property set which must support the properties from the service <member scope= "com::sun::star::sdbcx">table</member> @param _xMetaData @@ -458,12 +482,13 @@ @param _xTable The table. */ - ::rtl::OUString composeTableName(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData, + ::rtl::OUString composeTableName( + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable, - sal_Bool _bQuote, - EComposeRule _eComposeRule - ,sal_Bool _bUseCatalogInSelect = sal_True - ,sal_Bool _bUseSchemaInSelect = sal_True); + EComposeRule _eComposeRule, + bool _bSuppressCatalogName, + bool _bSuppressSchemaName, + bool _bQuote); //---------------------------------------------------------------------------------- sal_Int32 getSearchColumnFlag( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn, @@ -489,8 +514,19 @@ /** create a name which is a valid SQL 92 identifier name @param _rName the string which should be converted @param _rSpecials @see com.sun.star.sdbc.XDatabaseMetaData.getExtraNameCharacters + + @see isValidSQLName */ ::rtl::OUString convertName2SQLName(const ::rtl::OUString& _rName,const ::rtl::OUString& _rSpecials); + + /** checks whether the given name is a valid SQL name + + @param _rName the string which should be converted + @param _rSpecials @see com.sun.star.sdbc.XDatabaseMetaData.getExtraNameCharacters + + @see convertName2SQLName + */ + sal_Bool isValidSQLName( const ::rtl::OUString& _rName, const ::rtl::OUString& _rSpecials ); void showError( const SQLExceptionInfo& _rInfo, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _pParent, --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
