XConnection xConn = xConnector.connect("socket,host=localhost,port=6001");
if(xConn == null) System.err.println("no XConnection!");
IBridge iBridge = UnoRuntime.getBridgeByName("java", null, "remote", null, new Object[]{"iiop", xConn, null});
Object rInitialObject = iBridge.mapInterfaceFrom("classic_uno", XInterface.class);
if(rInitialObject != null)
{
System.err.println("got the remote object");
System.out.println("before naming service !");
try
{
XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, rInitialObject );
try
{
if(rName != null)
{
System.err.println("got the remote naming service !");
Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
if(rSmgr != null)
{
System.out.println("got the remote service manager !");
Object rDriver = rSmgr.createInstance("com.sun.star.sdbc.ADriver");
if(rDriver != null)
{
System.out.println("got a com.sun.star.sdbc.Driver !");
com.sun.star.sdbc.XDriver xDriver = (XDriver)UnoRuntime.queryInterface(com.sun.star.sdbc.XDriver.class,rDriver);
if(xDriver != null)