24#include <rtl/ustrbuf.hxx>
33 const Reference< XFastAttributeList > & _xAttrList) :
36 Reference<XPropertySet> xDataSource = rImport.
getDataSource();
38 PropertyValue aProperty;
40 OUString
sType,sHostName,sPortNumber,sDatabaseName;
45 OUString sValue = aIter.toString();
59 aProperty.Name =
"LocalSocket";
60 aProperty.Value <<= sValue;
64 sDatabaseName = sValue;
71 if (
sType.isEmpty() )
75 if (
sType ==
"sdbc:mysql:jdbc" ||
sType ==
"sdbc:mysqlc" ||
sType ==
"sdbc:mysql:mysqlc" )
77 sURL.append(
sType +
":" + sHostName);
78 if ( !sPortNumber.isEmpty() )
80 sURL.append(
":" + sPortNumber);
82 if ( !sDatabaseName.isEmpty() )
84 sURL.append(
"/" + sDatabaseName);
87 else if (
sType ==
"jdbc:oracle:thin" )
89 sURL.append(
"jdbc:oracle:thin:@" + sHostName);
90 if ( !sPortNumber.isEmpty() )
92 sURL.append(
":" + sPortNumber);
94 if ( !sDatabaseName.isEmpty() )
96 sURL.append(
":" + sDatabaseName);
99 else if (
sType ==
"sdbc:address:ldap" )
101 sURL.append(
"sdbc:address:ldap:" + sHostName);
102 if ( !sPortNumber.isEmpty() )
104 sURL.append(
":" + sPortNumber);
109 sURL.append(
sType +
":" + sHostName);
110 if ( !sPortNumber.isEmpty() )
112 sURL.append(
":" + sPortNumber);
114 if ( !sDatabaseName.isEmpty() )
116 sURL.append(
":" + sDatabaseName);
121 xDataSource->setPropertyValue(
PROPERTY_URL,
Any(sURL.makeStringAndClear()));
void addInfo(const css::beans::PropertyValue &_rInfo)
add an Info to the sequence which will be appended to the data source
const Reference< XPropertySet > & getDataSource() const
virtual ~OXMLServerDatabase() override
OXMLServerDatabase(ODBFilter &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_xAttrList)
#define DBG_UNHANDLED_EXCEPTION(...)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
constexpr OUStringLiteral PROPERTY_URL(u"URL")
#define XMLOFF_WARN_UNKNOWN(area, rIter)
constexpr sal_Int32 TOKEN_MASK