String dataSourceName = "Bibliography";
final connectivity.tools.DataSource bibliography = new connectivity.tools.DataSource(getFactory(), dataSourceName);
assureEquals("pre-registered database has a wrong name!", dataSourceName, bibliography.getName());
// 2. register a newly created data source, and verify it has the proper name
dataSourceName = "someDataSource";
final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface(
XNamingService.class, getFactory().createInstance("com.sun.star.sdb.DatabaseContext"));
dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource());
assureEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName());
}
catch (Exception ex)
{
Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex);