Examples of XTablesSupplier


Examples of com.sun.star.sdbcx.XTablesSupplier

                new HsqlColumnDescriptor( "Quantity", "INTEGER" ) } );
        m_database.createTable( table, true );

        // since we created the tables by directly executing the SQL statements, we need to refresh
        // the tables container
        XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
            XTablesSupplier.class, m_connection );
        XRefreshable refreshTables = (XRefreshable)UnoRuntime.queryInterface(
            XRefreshable.class, suppTables.getTables() );
        refreshTables.refresh();
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

        return xQueryNames;
    }

    public XNameAccess getTableNamesAsNameAccess()
    {
        XTablesSupplier xDBTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, DBConnection);
        XNameAccess xTableNames = xDBTables.getTables();
        return xTableNames;
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

    public void copyTable(final DatabaseApplication sourceDb,final DatabaseApplication destDb) throws Exception, IOException, java.lang.Exception
    {
        final XConnection destConnection = destDb.getDocumentUI().getActiveConnection();

        final XConnection sourceConnection = sourceDb.getDocumentUI().getActiveConnection();
        final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, sourceConnection);
        final XNameAccess tables = suppTables.getTables();

        final String[] names = tables.getElementNames();
        for (int i = 0; i < names.length; i++)
        {
            copyTable(names[i], sourceConnection, destConnection);
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

     *  This is usually necessary if you created tables by directly executing SQL statements,
     *  bypassing the SDBCX layer.
     */
    public void refreshTables(final com.sun.star.sdbc.XConnection _connection)
    {
        final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(
                XTablesSupplier.class, _connection);
        final XRefreshable refreshTables = (XRefreshable) UnoRuntime.queryInterface(
                XRefreshable.class, suppTables.getTables());
        refreshTables.refresh();
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

        // load the old document, and verify there is *no* table therein
        impl_switchToDocument(oldDocumentURL);
        m_documentUI.connect();
        assure("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected());
        XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class,
                m_documentUI.getActiveConnection());
        XNameAccess tables = suppTables.getTables();
        assure("the table was created in the wrong database", !tables.hasByName("abc"));

        // load the new document, and verify there *is* a table therein
        impl_switchToDocument(newDocumentURL);
        m_documentUI.connect();
        assure("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected());

        suppTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class,
                m_documentUI.getActiveConnection());
        tables = suppTables.getTables();
        assure("the newly created table has not been written", tables.hasByName("abc"));
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

    /** creates a table in the database. using the SDBCX-API
     */
    public void createTableInSDBCX(final HsqlTableDescriptor _tableDesc) throws SQLException, ElementExistException
    {
        final XPropertySet sdbcxDescriptor = _tableDesc.createSdbcxDescriptor(defaultConnection());
        final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(
                XTablesSupplier.class, defaultConnection());
        final XAppend appendTable = (XAppend) UnoRuntime.queryInterface(
                XAppend.class, suppTables.getTables());
        appendTable.appendByDescriptor(sdbcxDescriptor);
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

            para.setInt(1, i);
            para.setString(2, "Test" + i);
            prep.executeUpdate();
        }

        final XTablesSupplier suppTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, connection);
        final XRefreshable refresh = (XRefreshable) UnoRuntime.queryInterface(XRefreshable.class, suppTables.getTables());
        refresh.refresh();
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

        m_database.executeSQL( "INSERT INTO \"orders_details\" VALUES(2, 3, 2000)" );
        m_database.executeSQL( "INSERT INTO \"orders_details\" VALUES(2, 4, 2000)" );

        // since we created the tables by directly executing the SQL statements, we need to refresh
        // the tables container
        final XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
            XTablesSupplier.class, m_connection );
        final XRefreshable refreshTables = (XRefreshable)UnoRuntime.queryInterface(
            XRefreshable.class, suppTables.getTables() );
        refreshTables.refresh();
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

                    case HANDLE_TABLE:
                    {
                        // initial state for handling the tables

                        // get the table objects
                        final XTablesSupplier xSupplyTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, connection);
                        if (xSupplyTables != null)
                        {
                            xObjectCollection = xSupplyTables.getTables();
                            // if something went wrong 'til here, then this will be handled in the next state

                            // next state: get the object
                            }
                        eState = RETRIEVE_OBJECT;
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

                new HsqlColumnDescriptor( "Quantity", "INTEGER" ) } );
        m_database.createTable( table, true );

        // since we created the tables by directly executing the SQL statements, we need to refresh
        // the tables container
        XTablesSupplier suppTables = (XTablesSupplier)UnoRuntime.queryInterface(
            XTablesSupplier.class, m_connection );
        XRefreshable refreshTables = (XRefreshable)UnoRuntime.queryInterface(
            XRefreshable.class, suppTables.getTables() );
        refreshTables.refresh();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.