Package com.sun.star.sdbc

Examples of com.sun.star.sdbc.XDataSource


          XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
            // we use the first datasource
        XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
     
            log.println("check XMultiServiceFactory");
            XMultiServiceFactory xConn = (XMultiServiceFactory)
                        UnoRuntime.queryInterface(XMultiServiceFactory.class,
                        xDS.getConnection(new String(),new String()));

            log.println("check getAvailableServiceNames");
        String[] sServiceNames = xConn.getAvailableServiceNames();
            if (! sServiceNames[0].equals("com.sun.star.sdb.SingleSelectQueryComposer"))
            {
View Full Code Here


        addResult(sMessage,check);
    }

    public void test(){
        mThreadTimeOut = 10000000;
        XDataSource ds = null;
        System.gc();
        try {
            XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.sdb.DatabaseContext"));
            ds = (XDataSource)UnoRuntime.queryInterface(XDataSource.class,xNameAccess.getByName("file:///g:/test.odb"));
        } catch(Exception ex) {
View Full Code Here

  /** ensures that the tables we need for our example exist
  */
  protected void ensureTables() throws java.lang.Exception
  {
    // get the data source
    XDataSource xDS = m_database.getDataSource();
    XPropertySet xDSProps = UNO.queryPropertySet( xDS );

    // connect to this data source
    XConnection xConn = xDS.getConnection( "", "" );
    XComponent xConnComp = UNO.queryComponent( xConn );

        createTableSalesman( xConn );
        createTableCustomer( xConn );
        createTableSales( xConn );
View Full Code Here

        XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();

          XNameAccess xNameAccess = null;
           
            // we use the first datasource
        XDataSource xDS = null;
        try {
            xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
        } catch (Exception ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get Databasecontext", ex );
        }
        try {
            xDS = (XDataSource) UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
        } catch (NoSuchElementException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XDataSource", ex );
        } catch (WrappedTargetException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XDataSource", ex );
        }
        try {
            xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
        } catch (Exception ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get DatabaseConext", ex );
        }
     
            log.println("check XMultiServiceFactory");

        try {
            xConn = xDS.getConnection(new String(), new String());
        } catch (SQLException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XConnection", ex );
        }
View Full Code Here

          XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
            // we use the first datasource
        XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
     
            log.println("check XMultiServiceFactory");
            XMultiServiceFactory xConn = (XMultiServiceFactory)
                        UnoRuntime.queryInterface(XMultiServiceFactory.class,
                        xDS.getConnection(new String(),new String()));

            log.println("check getAvailableServiceNames");
        String[] sServiceNames = xConn.getAvailableServiceNames();
            if (! sServiceNames[0].equals("com.sun.star.sdb.SingleSelectQueryComposer"))
            {
View Full Code Here

          XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
            // we use the first datasource
        XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
     
            log.println("check XMultiServiceFactory");
            XMultiServiceFactory xConn = (XMultiServiceFactory)
                        UnoRuntime.queryInterface(XMultiServiceFactory.class,
                        xDS.getConnection(new String(),new String()));

            log.println("check getAvailableServiceNames");
        String[] sServiceNames = xConn.getAvailableServiceNames();
            if (! sServiceNames[0].equals("com.sun.star.sdb.SingleSelectQueryComposer"))
            {
View Full Code Here

        XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();

          XNameAccess xNameAccess = null;
           
            // we use the first datasource
        XDataSource xDS = null;
        try {
            xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
        } catch (Exception ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get Databasecontext", ex );
        }
        try {
            xDS = (XDataSource) UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
        } catch (NoSuchElementException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XDataSource", ex );
        } catch (WrappedTargetException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XDataSource", ex );
        }
        try {
            xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
        } catch (Exception ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get DatabaseConext", ex );
        }
     
            log.println("check XMultiServiceFactory");

        try {
            xConn = xDS.getConnection(new String(), new String());
        } catch (SQLException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XConnection", ex );
        }
View Full Code Here

  /** ensures that the tables we need for our example exist
  */
  protected void ensureTables() throws java.lang.Exception
  {
    // get the data source
    XDataSource xDS = m_database.getDataSource();
    XPropertySet xDSProps = UNO.queryPropertySet( xDS );

    // connect to this data source
    XConnection xConn = xDS.getConnection( "", "" );
    XComponent xConnComp = UNO.queryComponent( xConn );

        createTableSalesman( xConn );
        createTableCustomer( xConn );
        createTableSales( xConn );
View Full Code Here

          XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
            // we use the first datasource
        XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
     
            log.println("check XMultiServiceFactory");
            XMultiServiceFactory xConn = (XMultiServiceFactory)
                        UnoRuntime.queryInterface(XMultiServiceFactory.class,
                        xDS.getConnection(new String(),new String()));

            log.println("check getAvailableServiceNames");
        String[] sServiceNames = xConn.getAvailableServiceNames();
            if (! sServiceNames[0].equals("com.sun.star.sdb.SingleSelectQueryComposer"))
            {
View Full Code Here

    public void assurePublic(String sMessage,boolean check){
        super.assure(sMessage,check);
    }

    public void test(){
        XDataSource ds = null;
        System.gc();
        try {
            HsqlDatabase database = new HsqlDatabase( (XMultiServiceFactory)param.getMSF() );
            ds = database.getDataSource().getXDataSource();
        } catch(Exception ex) {
View Full Code Here

TOP

Related Classes of com.sun.star.sdbc.XDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.