if (xConnection != null)
{
com.sun.star.container.XChild child = (com.sun.star.container.XChild) UnoRuntime.queryInterface(com.sun.star.container.XChild.class, xConnection);
xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, child.getParent());
XDocumentDataSource xDocu = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, this.xDataSource);
if (xDocu != null)
{
xModel = xDocu.getDatabaseDocument();
}
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDataSource);
if (xPSet != null)
{
DataSourceName = AnyConverter.toString(xPSet.getPropertyValue("Name"));
}
return getConnection(xConnection);
}
else
{
bdisposeConnection = true;
}
}
else
{
bdisposeConnection = true;
}
if (Properties.hasPropertyValue(curproperties, "DataSourceName"))
{
String sDataSourceName = AnyConverter.toString(Properties.getPropertyValue(curproperties, "DataSourceName"));
return getConnection(sDataSourceName);
}
else if (Properties.hasPropertyValue(curproperties, "DataSource"))
{
xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, Properties.getPropertyValue(curproperties, "DataSource"));
XDocumentDataSource xDocu = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, this.xDataSource);
if (xDocu != null)
{
xModel = xDocu.getDatabaseDocument();
}
return getConnection(xDataSource);
}
if (Properties.hasPropertyValue(curproperties, "DatabaseLocation"))
{