Examples of XTablesSupplier


Examples of com.sun.star.sdbcx.XTablesSupplier

           
        }

        public boolean getConnection(PropertyValue[] _curPropertyValue){
            if (super.getConnection(_curPropertyValue)){
                XTablesSupplier xDBTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, DBConnection);
                xTableNames =  xDBTables.getTables();
                xTableAppend = (XAppend) UnoRuntime.queryInterface(XAppend.class, xTableNames);
                xTableDrop = (XDrop) UnoRuntime.queryInterface(XDrop.class, xTableNames);
                xTableDataDescriptorFactory = (XDataDescriptorFactory) UnoRuntime.queryInterface(XDataDescriptorFactory.class, xTableNames);
                xPropTableDataDescriptor = xTableDataDescriptorFactory.createDataDescriptor();
                XColumnsSupplier xColumnsSupplier = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xPropTableDataDescriptor);    
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

        return xQueryNames;
    }

    public XNameAccess getTableNamesAsNameAccess()
    {
        XTablesSupplier xDBTables = UnoRuntime.queryInterface( XTablesSupplier.class, DBConnection );
        return xDBTables.getTables();
    }
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();
        assertTrue("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected());
        XTablesSupplier suppTables = UnoRuntime.queryInterface( XTablesSupplier.class, m_documentUI.getActiveConnection() );
        XNameAccess tables = suppTables.getTables();
        assertTrue("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();
        assertTrue("could not connect to " + m_database.getDocumentURL(), m_documentUI.isConnected());

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

Examples of com.sun.star.sdbcx.XTablesSupplier

                "specified info");
            tRes.tested("getDataDefinitionByConnection()",
                        Status.skipped(false));
            return;
        }
        XTablesSupplier xTS = null;
        try {
            log.println("getDataDefinitionByConnection(connection)");
            xTS = oObj.getDataDefinitionByConnection(connection);
            bRes = xTS != null;
        } catch(com.sun.star.sdbc.SQLException e) {
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

     * <code>XDriver.UNSUITABLE_URL</code> and checks that SQLException
     * exception was thrown.
     */
    public void _getDataDefinitionByURL() {
        boolean bRes = false;
    XTablesSupplier xTS = null;

        try {
            log.println("getDataDefinitionByURL('" + url + "')");
            xTS = oObj.getDataDefinitionByURL(url, info);
            bRes = xTS != null;
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

     */
    @Test
    public void testSubQueries() throws Exception
    {
        m_composer.setQuery("SELECT * from \"" + INNERPRODUCTSQUERY + "\"");
        final XTablesSupplier suppTables = UnoRuntime.queryInterface(XTablesSupplier.class, m_composer);
        final XNameAccess tables = suppTables.getTables();
        assertTrue("a simple SELECT * FROM <query> could not be parsed",
                tables != null && tables.hasByName(INNERPRODUCTSQUERY));

        final String sInnerCommand = m_database.getDatabase().getDataSource().getQueryDefinition(INNERPRODUCTSQUERY).getCommand();
        final String sExecutableQuery = m_composer.getQueryWithSubstitution();
View Full Code Here

Examples of com.sun.star.sdbcx.XTablesSupplier

    private 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 = 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

                    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

                    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

        return m_columns;
    }

    public XPropertySet createSdbcxDescriptor( Connection _forConnection )
    {
        XTablesSupplier suppTables = UnoRuntime.queryInterface( XTablesSupplier.class, _forConnection.getXConnection() );
        XDataDescriptorFactory tableDescFac = UnoRuntime.queryInterface( XDataDescriptorFactory.class, suppTables.getTables() );
        XPropertySet tableDesc = tableDescFac.createDataDescriptor();

        try
        {
            tableDesc.setPropertyValue( "Name", getName() );
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.