20#include <osl/diagnose.h>
22#include <com/sun/star/container/XNameAccess.hpp>
23#include <com/sun/star/sdbc/DataType.hpp>
24#include <com/sun/star/sdbc/XConnection.hpp>
25#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
26#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
27#include <com/sun/star/sdb/XQueriesSupplier.hpp>
28#include <com/sun/star/beans/XPropertySet.hpp>
50 bool bIsTable,
const OUString& rFieldName)
60 pDBManager = pView->GetWrtShell().GetDBManager();
65 Reference< XConnection> xConnection =
68 if( !xConnection.is() )
71 Reference<XColumnsSupplier> xColsSupplier;
74 Reference<XTablesSupplier> xTSupplier(xConnection, UNO_QUERY);
77 Reference<XNameAccess> xTables = xTSupplier->getTables();
78 OSL_ENSURE(xTables->hasByName(rTableQryName),
"table not available anymore?");
81 Any aTable = xTables->getByName(rTableQryName);
82 Reference<XPropertySet> xPropSet;
84 xColsSupplier.set(xPropSet, UNO_QUERY);
93 Reference<XQueriesSupplier> xQSupplier(xConnection, UNO_QUERY);
96 Reference<XNameAccess> xQueries = xQSupplier->getQueries();
97 OSL_ENSURE(xQueries->hasByName(rTableQryName),
"table not available anymore?");
100 Any aQuery = xQueries->getByName(rTableQryName);
101 Reference<XPropertySet> xPropSet;
103 xColsSupplier.set(xPropSet, UNO_QUERY);
111 if(xColsSupplier.is())
113 Reference <XNameAccess> xCols;
116 xCols = xColsSupplier->getColumns();
122 if(xCols.is() && xCols->hasByName(rFieldName))
124 Any aCol = xCols->getByName(rFieldName);
125 Reference <XPropertySet> xCol;
127 Any aType = xCol->getPropertyValue(
"Type");
128 sal_Int32 eDataType = 0;
133 case DataType::BOOLEAN:
134 case DataType::TINYINT:
135 case DataType::SMALLINT:
136 case DataType::INTEGER:
137 case DataType::BIGINT:
138 case DataType::FLOAT:
140 case DataType::DOUBLE:
141 case DataType::NUMERIC:
142 case DataType::DECIMAL:
145 case DataType::TIMESTAMP:
148 case DataType::BINARY:
149 case DataType::VARBINARY:
150 case DataType::LONGVARBINARY:
151 case DataType::SQLNULL:
152 case DataType::OTHER:
153 case DataType::OBJECT:
154 case DataType::DISTINCT:
155 case DataType::STRUCT:
156 case DataType::ARRAY:
161 case DataType::VARCHAR:
162 case DataType::LONGVARCHAR:
css::uno::Reference< css::sdbc::XConnection > const & RegisterConnection(OUString const &rSource)
create and store or find an already stored connection to a data source for use in SwFieldMgr and SwDB...
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
bool IsDBNumeric(const OUString &rDBName, const OUString &rTableQryName, bool bIsTable, const OUString &rFieldName)
#define TOOLS_WARN_EXCEPTION(area, stream)