LibreOffice Module connectivity (master) 1
|
#include <sal/config.h>
#include <string_view>
#include <connectivity/dbexception.hxx>
#include <comphelper/stl_types.hxx>
#include <unotools/sharedunocomponent.hxx>
#include <connectivity/dbtoolsdllapi.hxx>
#include <connectivity/FValue.hxx>
Go to the source code of this file.
Namespaces | |
namespace | com |
namespace | com::sun |
namespace | com::sun::star |
namespace | com::sun::star::sdb |
namespace | com::sun::star::sdbcx |
namespace | com::sun::star::sdbc |
namespace | com::sun::star::beans |
namespace | com::sun::star::awt |
namespace | com::sun::star::lang |
namespace | com::sun::star::container |
namespace | com::sun::star::uno |
namespace | com::sun::star::util |
namespace | com::sun::star::task |
namespace | dbtools |
namespace | connectivity |
namespace | connectivity::dbase |
Typedefs | |
typedef ::utl::SharedUNOComponent< css::sdbc::XConnection > | dbtools::SharedConnection |
typedef ::std::pair< bool, bool > | dbtools::TBoolPair |
typedef ::std::pair< TBoolPair, sal_Int32 > | dbtools::ColumnInformation |
typedef ::std::multimap< OUString, ColumnInformation, ::comphelper::UStringMixLess > | dbtools::ColumnInformationMap |
Enumerations | |
enum class | dbtools::EComposeRule { dbtools::InTableDefinitions , dbtools::InIndexDefinitions , dbtools::InDataManipulation , dbtools::InProcedureCalls , dbtools::InPrivilegeDefinitions , dbtools::Complete } |
enum | connectivity::dbase::DBFType { connectivity::dbase::dBaseIII = 0x03 , connectivity::dbase::dBaseIV = 0x04 , connectivity::dbase::dBaseV = 0x05 , connectivity::dbase::VisualFoxPro = 0x30 , connectivity::dbase::VisualFoxProAuto = 0x31 , connectivity::dbase::dBaseFS = 0x43 , connectivity::dbase::dBaseFSMemo = 0xB3 , connectivity::dbase::dBaseIIIMemo = 0x83 , connectivity::dbase::dBaseIVMemo = 0x8B , connectivity::dbase::dBaseIVMemoSQL = 0x8E , connectivity::dbase::FoxProMemo = 0xF5 } |
Functions | |
OOO_DLLPUBLIC_DBTOOLS sal_Int32 | dbtools::getDefaultNumberFormat (const css::uno::Reference< css::beans::XPropertySet > &_xColumn, const css::uno::Reference< css::util::XNumberFormatTypes > &_xTypes, const css::lang::Locale &_rLocale) |
OOO_DLLPUBLIC_DBTOOLS sal_Int32 | dbtools::getDefaultNumberFormat (sal_Int32 _nDataType, sal_Int32 _nScale, bool _bIsCurrency, const css::uno::Reference< css::util::XNumberFormatTypes > &_xTypes, const css::lang::Locale &_rLocale) |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbc::XConnection > | dbtools::connectRowset (const css::uno::Reference< css::sdbc::XRowSet > &_rxRowSet, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::awt::XWindow > &_rxParent) |
creates a connection which can be used for the rowset given More... | |
OOO_DLLPUBLIC_DBTOOLS SharedConnection | dbtools::ensureRowSetConnection (const css::uno::Reference< css::sdbc::XRowSet > &_rxRowSet, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::awt::XWindow > &_rxParent) |
ensures that a row set has a valid ActiveConnection, if possible More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbc::XConnection > | dbtools::getConnection (const css::uno::Reference< css::sdbc::XRowSet > &_rxRowSet) |
returns the connection the RowSet is currently working with (which is the ActiveConnection property) More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbc::XConnection > | dbtools::getConnection_withFeedback (const OUString &_rDataSourceName, const OUString &_rUser, const OUString &_rPwd, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::awt::XWindow > &_rxParent) |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::isEmbeddedInDatabase (const css::uno::Reference< css::uno::XInterface > &_rxComponent, css::uno::Reference< css::sdbc::XConnection > &_rxActualConnection) |
determines whether the given component is part of a document which is an embedded database document (such as a form) More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::container::XNameAccess > | dbtools::getTableFields (const css::uno::Reference< css::sdbc::XConnection > &_rxConn, const OUString &_rName) |
returns the columns of the named table of the given connection More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::container::XNameAccess > | dbtools::getPrimaryKeyColumns_throw (const css::uno::Any &i_aTable) |
returns the primary key columns of the table More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::container::XNameAccess > | dbtools::getPrimaryKeyColumns_throw (const css::uno::Reference< css::beans::XPropertySet > &i_xTable) |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::container::XNameAccess > | dbtools::getFieldsByCommandDescriptor (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const sal_Int32 _nCommandType, const OUString &_rCommand, css::uno::Reference< css::lang::XComponent > &_rxKeepFieldsAlive, SQLExceptionInfo *_pErrorInfo=nullptr) |
get fields for a result set given by a "command descriptor" More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Sequence< OUString > | dbtools::getFieldNamesByCommandDescriptor (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const sal_Int32 _nCommandType, const OUString &_rCommand, SQLExceptionInfo *_pErrorInfo=nullptr) |
get fields for a result set given by a "command descriptor" More... | |
OOO_DLLPUBLIC_DBTOOLS css::sdbc::SQLException | dbtools::prependErrorInfo (const css::sdbc::SQLException &_rChainedException, const css::uno::Reference< css::uno::XInterface > &_rxContext, const OUString &_rAdditionalError, const StandardSQLState _eSQLState=StandardSQLState::ERROR_UNSPECIFIED) |
create a new css::sdbc::SQLContext, fill it with the given descriptions and the given source, and append _rException (i.e. More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbc::XDataSource > | dbtools::findDataSource (const css::uno::Reference< css::uno::XInterface > &_xParent) |
search the parent hierarchy for a data source. More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::getBooleanDataSourceSetting (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const char *_pAsciiSettingName) |
determines the value of a boolean data source setting, given by ASCII name More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::getBooleanDataSourceSetting (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const OUString &rSettingName) |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::isDataSourcePropertyEnabled (const css::uno::Reference< css::uno::XInterface > &_xProp, const OUString &_sProperty, bool _bDefault) |
check if a specific property is enabled in the info sequence More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::getDataSourceSetting (const css::uno::Reference< css::uno::XInterface > &_rxDataSource, const char *_pAsciiSettingsName, css::uno::Any &_rSettingsValue) |
retrieves a particular indirect data source setting More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::getDataSourceSetting (const css::uno::Reference< css::uno::XInterface > &_rxDataSource, const OUString &_sSettingsName, css::uno::Any &_rSettingsValue) |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::getDefaultReportEngineServiceName (const css::uno::Reference< css::uno::XComponentContext > &_rxFactory) |
OUString | dbtools::quoteName (std::u16string_view _rQuote, const OUString &_rName) |
quote the given name with the given quote string. More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::quoteTableName (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxMeta, const OUString &_rName, EComposeRule _eComposeRule) |
quote the given table name (which may contain a catalog and a schema) according to the rules provided by the meta data More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::qualifiedNameComponents (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxConnMetaData, const OUString &_rQualifiedName, OUString &_rCatalog, OUString &_rSchema, OUString &_rName, EComposeRule _eComposeRule) |
split a fully qualified table name (including catalog and schema, if applicable) into its component parts. More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::util::XNumberFormatsSupplier > | dbtools::getNumberFormats (const css::uno::Reference< css::sdbc::XConnection > &_rxConn, bool _bAllowDefault=false, const css::uno::Reference< css::uno::XComponentContext > &_rxContext=css::uno::Reference< css::uno::XComponentContext >()) |
calculate a NumberFormatsSupplier for use with a given connection More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdb::XSingleSelectQueryComposer > | dbtools::getCurrentSettingsComposer (const css::uno::Reference< css::beans::XPropertySet > &_rxRowSetProps, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const css::uno::Reference< css::awt::XWindow > &_rxParent) |
create a css::sdb::XSingleSelectQueryComposer which represents the current settings (Command/CommandType/Filter/Order) of the given rowset. More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::TransferFormComponentProperties (const css::uno::Reference< css::beans::XPropertySet > &_rxOld, const css::uno::Reference< css::beans::XPropertySet > &_rxNew, const css::lang::Locale &_rLocale) |
transfer and translate properties between two FormComponents More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::canInsert (const css::uno::Reference< css::beans::XPropertySet > &_rxCursorSet) |
check if the property "Privileges" supports css::sdbcx::Privilege::INSERT More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::canUpdate (const css::uno::Reference< css::beans::XPropertySet > &_rxCursorSet) |
check if the property "Privileges" supports css::sdbcx::Privilege::UPDATE More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::canDelete (const css::uno::Reference< css::beans::XPropertySet > &_rxCursorSet) |
check if the property "Privileges" supports css::sdbcx::Privilege::DELETE More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::composeTableName (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxMetaData, const OUString &_rCatalog, const OUString &_rSchema, const OUString &_rName, bool _bQuote, EComposeRule _eComposeRule) |
compose a complete table name from its up to three parts, regarding to the database meta data composing rules More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::composeTableNameForSelect (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const OUString &_rCatalog, const OUString &_rSchema, const OUString &_rName) |
composes a table name for usage in a SELECT statement More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::composeTableNameForSelect (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::beans::XPropertySet > &_xTable) |
composes a table name for usage in a SELECT statement More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::composeTableName (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_xMetaData, const css::uno::Reference< css::beans::XPropertySet > &_xTable, EComposeRule _eComposeRule, bool _bQuote) |
compose the table name out of the property set which must support the properties from the service <member scope= "css::sdbcx">table</member> More... | |
OOO_DLLPUBLIC_DBTOOLS sal_Int32 | dbtools::getSearchColumnFlag (const css::uno::Reference< css::sdbc::XConnection > &_rxConn, sal_Int32 _nDataType) |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbc::XDataSource > | dbtools::getDataSource (const OUString &_rsDataSourceName, const css::uno::Reference< css::uno::XComponentContext > &_rxContext) |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createUniqueName (const css::uno::Reference< css::container::XNameAccess > &_rxContainer, const OUString &_rBaseName, bool _bStartWithNumber=true) |
search for a name that is NOT in the NameAcces More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createUniqueName (const css::uno::Sequence< OUString > &_rNames, const OUString &_rBaseName, bool _bStartWithNumber) |
creates a unique name which is not already used in the given name array More... | |
OUString | dbtools::convertName2SQLName (const OUString &_rName, std::u16string_view _rSpecials) |
create a name which is a valid SQL 92 identifier name More... | |
bool | dbtools::isValidSQLName (const OUString &_rName, std::u16string_view _rSpecials) |
checks whether the given name is a valid SQL name More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::showError (const SQLExceptionInfo &_rInfo, const css::uno::Reference< css::awt::XWindow > &_pParent, const css::uno::Reference< css::uno::XComponentContext > &_rxContext) |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::implUpdateObject (const css::uno::Reference< css::sdbc::XRowUpdate > &_rxUpdatedObject, const sal_Int32 _nColumnIndex, const css::uno::Any &_rValue) |
implements <method scope="com.sun.star.sdb">XRowUpdate::updateObject</method> More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::askForParameters (const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > &_xComposer, const css::uno::Reference< css::sdbc::XParameters > &_xParameters, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::task::XInteractionHandler > &_rxHandler, const ::std::vector< bool, std::allocator< bool > > &_aParametersSet=::std::vector< bool, std::allocator< bool > >()) |
ask the user for parameters if the prepared statement needs some and sets them in the prepared statement More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::setObjectWithInfo (const css::uno::Reference< css::sdbc::XParameters > &_xParameters, sal_Int32 parameterIndex, const css::uno::Any &x, sal_Int32 sqlType, sal_Int32 scale=0) |
call the appropriate set method for the specific sql type More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::setObjectWithInfo (const css::uno::Reference< css::sdbc::XParameters > &_xParameters, sal_Int32 parameterIndex, const ::connectivity::ORowSetValue &x, sal_Int32 sqlType, sal_Int32 scale) |
call the appropriate set method for the specific sql type More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::implSetObject (const css::uno::Reference< css::sdbc::XParameters > &_rxParameters, const sal_Int32 _nColumnIndex, const css::uno::Any &_rValue) |
implements <method scope="com.sun.star.sdb">XParameters::setObject</method> More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createStandardCreateStatement (const css::uno::Reference< css::beans::XPropertySet > &descriptor, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, ISQLStatementHelper *_pHelper, std::u16string_view _sCreatePattern) |
creates the standard sql create table statement without the key part. More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createStandardKeyStatement (const css::uno::Reference< css::beans::XPropertySet > &descriptor, const css::uno::Reference< css::sdbc::XConnection > &_xConnection) |
creates the standard sql statement for the key part of a create table statement. More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createStandardTypePart (const css::uno::Reference< css::beans::XPropertySet > &descriptor, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, std::u16string_view _sCreatePattern={}) |
creates the standard sql statement for the type part of a create or alter table statement. More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createStandardColumnPart (const css::uno::Reference< css::beans::XPropertySet > &descriptor, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, ISQLStatementHelper *_pHelper=nullptr, std::u16string_view _sCreatePattern={}) |
creates the standard sql statement for the column part of a create table statement. More... | |
OOO_DLLPUBLIC_DBTOOLS OUString | dbtools::createSqlCreateTableStatement (const css::uno::Reference< css::beans::XPropertySet > &descriptor, const css::uno::Reference< css::sdbc::XConnection > &_xConnection) |
creates a SQL CREATE TABLE statement More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::beans::XPropertySet > | dbtools::createSDBCXColumn (const css::uno::Reference< css::beans::XPropertySet > &_xTable, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const OUString &_rName, bool _bCase, bool _bQueryForInfo, bool _bIsAutoIncrement, bool _bIsCurrency, sal_Int32 _nDataType) |
creates a SDBC column with the help of getColumns. More... | |
OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbcx::XTablesSupplier > | dbtools::getDataDefinitionByURLAndConnection (const OUString &_rsUrl, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::uno::XComponentContext > &_rxContext) |
tries to locate the corresponding DataDefinitionSupplier for the given url and connection More... | |
OOO_DLLPUBLIC_DBTOOLS sal_Int32 | dbtools::getTablePrivileges (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_xMetaData, const OUString &_sCatalog, const OUString &_sSchema, const OUString &_sTable) |
returns the table privileges to the given parameters More... | |
OOO_DLLPUBLIC_DBTOOLS void | dbtools::collectColumnInformation (const css::uno::Reference< css::sdbc::XConnection > &_xConnection, std::u16string_view _sComposedTableName, std::u16string_view _rName, ColumnInformationMap &_rInfo) |
collects the information about auto increment, currency and data type for the given column name. More... | |
void | dbtools::getBooleanComparisonPredicate (std::u16string_view _rExpression, const bool _bValue, const sal_Int32 _nBooleanComparisonMode, OUStringBuffer &_out_rSQLPredicate) |
adds a boolean comparison clause to the given SQL predicate More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::isAggregateColumn (const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > &_xComposer, const css::uno::Reference< css::beans::XPropertySet > &_xField) |
is this field an aggregate? More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::isAggregateColumn (const css::uno::Reference< css::container::XNameAccess > &_xColumns, const OUString &_sName) |
is this column an aggregate? More... | |
OOO_DLLPUBLIC_DBTOOLS bool | dbtools::isAggregateColumn (const css::uno::Reference< css::beans::XPropertySet > &_xColumn) |
is this column an aggregate? More... | |
bool | connectivity::dbase::dbfDecodeCharset (rtl_TextEncoding &_out_nCharset, sal_uInt8 nType, sal_uInt8 nCodepage) |
decode a DBase file's codepage byte to a RTL charset More... | |
bool | connectivity::dbase::dbfReadCharset (rtl_TextEncoding &nCharSet, SvStream *dbf_Stream) |
decode a DBase file's codepage byte to a RTL charset More... | |