xMSF = (XMultiServiceFactory)Param.getMSF();
try{
oInterface = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
if (oInterface == null)
throw new StatusException("Could not get service 'com.sun.star.sdb.DatabaseContext'", new Exception());
}catch( Exception e ) {
log.println("Could not get service 'com.sun.star.sdb.DatabaseContext'" );
e.printStackTrace ();
throw new StatusException("Service not available", e) ;
}
xDBContextNameServ = (XNamingService)
UnoRuntime.queryInterface(XNamingService.class, oInterface) ;
// retrieving temp directory for database
String tmpDatabaseUrl = utils.getOfficeTempDir((XMultiServiceFactory)Param.getMSF());
tmpDatabaseUrl = "sdbc:dbase:file:///" + tmpDatabaseUrl ;
try{
XInterface oDatabaseDoc = (XInterface) xMSF.createInstance
("com.sun.star.sdb.OfficeDatabaseDocument") ;
if (oDatabaseDoc == null)
throw new StatusException("Could not get service 'com.sun.star.sdb.OfficeDatabaseDocument'", new Exception());
xDBDoc = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
XOfficeDatabaseDocument.class,
oDatabaseDoc);
}