Examples of XRow


Examples of com.sun.star.sdbc.XRow

        if (xResultSet.first())
        {
            // obtain XContentAccess interface for child content access and XRow for properties
            XContentAccess xContentAccess = UnoRuntime.queryInterface(
                XContentAccess.class, xResultSet);
            XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet);
            do
            {
                // Obtain URL of child.
                String aId = xContentAccess.queryContentIdentifierString();
                // First column: Title (column numbers are 1-based!)
                String aTitle = xRow.getString(1);
                if (aTitle.length() == 0 && xRow.wasNull())
                {
                    //ignore
                }
                else
                {
View Full Code Here

Examples of com.sun.star.sdbc.XRow

        pv[0] = new Property();
        pv[0].Name = propName;
        pv[0].Handle = -1;
   
        Object row = executeCommand(content,"getPropertyValues",pv);
        XRow xrow = UnoRuntime.queryInterface(XRow.class,row);
        if (type.equals(String.class))
        {
           return xrow.getString(1);
        }
        else if (type.equals(Boolean.class))
        {
            return xrow.getBoolean(1) ? Boolean.TRUE : Boolean.FALSE;
        }
        else if (type.equals(Integer.class))
        {
            return new Integer(xrow.getInt(1));
        }
        else if (type.equals(Short.class))
        {
            return new Short(xrow.getShort(1));
        }
        else
        {
            return null;
        }
View Full Code Here

Examples of com.sun.star.sdbc.XRow

        try
        {
            String[] sTableNames = super.getCommandMetaData().getTableNames();
            Vector aReferencedTableVector = new Vector();
            XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getExportedKeys((getCatalogName(this)), getSchemaName(), getTableName());
            XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet);
            while (xResultSet.next())
            {
                String sForeignCatalog = xRow.getString(FKTABLE_CAT);
                String sForeignScheme = xRow.getString(FKTABLE_SCHEM);
                String sForeignTableName = xRow.getString(FKTABLE_NAME);
                CommandName oCommandName = new CommandName(getCommandMetaData(), sForeignCatalog, sForeignScheme, sForeignTableName, false);
                aReferencedTableVector.add(oCommandName.getComposedName());
            }
            sReferencedTableNames = new String[aReferencedTableVector.size()];
            aReferencedTableVector.toArray(sReferencedTableNames);
View Full Code Here

Examples of com.sun.star.sdbc.XRow

        };
        try
        {
            CommandName oLocCommandName = new CommandName(super.getCommandMetaData(), _sreferencedtablename);
            XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getImportedKeys(getCatalogName(oLocCommandName), oLocCommandName.getSchemaName(), oLocCommandName.getTableName());
            XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet);
            boolean bleaveLoop = false;
            Vector aMasterFieldNamesVector = new Vector();
            Vector aSlaveFieldNamesVector = new Vector();
            while (xResultSet.next() && !bleaveLoop)
            {
                String sPrimaryCatalog = null;
                String sPrimarySchema = null;
                if (super.getCommandMetaData().xDBMetaData.supportsCatalogsInDataManipulation())
                {
                    sPrimaryCatalog = xRow.getString(PKTABLE_CAT);
                }
                if (super.getCommandMetaData().xDBMetaData.supportsSchemasInDataManipulation())
                {
                    sPrimarySchema = xRow.getString(PKTABLE_SCHEM);
                }
                String sPrimaryTableName = xRow.getString(PKTABLE_NAME);
                String sPrimaryColumnName = xRow.getString(PKCOLUMN_NAME);
                String sForeignColumnName = xRow.getString(FKCOLUMN_NAME);
                if (JavaTools.isSame(getTableName(), sPrimaryTableName))
                {
                    if (sPrimarySchema == null || JavaTools.isSame(getSchemaName(), sPrimarySchema))
                    {
                        if (JavaTools.isSame(getCatalogName(), sPrimaryCatalog))
View Full Code Here

Examples of com.sun.star.sdbc.XRow

    * Has OK status if the method return not empty value.
    */
    public void _getWarnings() {
        final XRowUpdate rowUpdate = UnoRuntime.queryInterface(XRowUpdate.class, oObj);
        final XResultSetUpdate resultSetUpdate = UnoRuntime.queryInterface(XResultSetUpdate.class, rowUpdate);
        final XRow row = UnoRuntime.queryInterface(XRow.class, resultSetUpdate);
        if ( row == null)
            throw new StatusException(Status.failed("Test must be modified"));

        // not sure what the below test was intended to test, but it actually fails with an SQLException (which is
        // correct for what is done there), and thus makes the complete interface test fail (which is not correct)
        // So, for the moment, just let the test succeed all the time - until issue #i84235# is fixed
       
        if ( false )
        {
            int oldVal = 0, newVal = 0;
            String valToSet = "9999999999999999";
            try
            {
                oldVal = row.getInt(DBTools.TST_INT);
                rowUpdate.updateString(DBTools.TST_INT, valToSet);
                resultSetUpdate.updateRow();
                newVal = row.getInt(DBTools.TST_INT);
            }
            catch(com.sun.star.sdbc.SQLException e)
            {
                log.println("Unexpected SQL exception");
                e.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.sdbc.XRow

    * refreshRow() equals to saved value.
    */
    public void _refreshRow() {
        XRowUpdate xRowUpdate = (XRowUpdate)
            UnoRuntime.queryInterface(XRowUpdate.class, oObj);
        XRow xRow = (XRow)UnoRuntime.queryInterface(XRow.class, oObj);

        if (xRowUpdate == null || xRow == null) {
            log.println("Test must be modified because XRow or XRowUpdate is't supported");
            log.println("Only call method");
            try {
                oObj.refreshRow() ;
                tRes.tested("refreshRow()", true) ;
            } catch (SQLException e) {
                log.println("Exception occured :") ;
                e.printStackTrace(log) ;
                tRes.tested("refreshRow()", false) ;
            }
        } else {
            log.println("Testing of refreshRow()...");
            try {
                String oldValue = xRow.getString(util.DBTools.TST_STRING);
                log.println("Old value: " + oldValue);
                xRowUpdate.updateString(util.DBTools.TST_STRING,
                    "Test method refreshRow");
                log.println("New value: "
                    + xRow.getString(util.DBTools.TST_STRING));
                oObj.refreshRow();
                String valAfterRefresh =
                    xRow.getString(util.DBTools.TST_STRING);
                log.println("Value after refresh: " + valAfterRefresh);
                tRes.tested("refreshRow()", valAfterRefresh.equals(oldValue));
            } catch(SQLException e) {
                log.println("Exception occured :");
                e.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.sdbc.XRow

        }

        // Adding relation for XResultSetUpdate
        final XRowUpdate xRowUpdate = (XRowUpdate) UnoRuntime.queryInterface(
                                              XRowUpdate.class, oObj);
        final XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, oObj);

        tEnv.addObjRelation("XResultSetUpdate.UpdateTester",
                            new ifc.sdbc._XResultSetUpdate.UpdateTester() {
            String lastUpdate = null;

            public int rowCount() throws SQLException {
                int prevPos = xResSet.getRow();
                xResSet.last();

                int count = xResSet.getRow();
                xResSet.absolute(prevPos);

                return count;
            }

            public void update() throws SQLException {
                lastUpdate = xRow.getString(1);
                lastUpdate += "_";
                xRowUpdate.updateString(1, lastUpdate);
            }

            public boolean wasUpdated() throws SQLException {
                String getStr = xRow.getString(1);

                return lastUpdate.equals(getStr);
            }

            public int currentRow() throws SQLException {
                return xResSet.getRow();
            }
        });

        // Adding relations for XRow as a Vector with all data
        // of current row of RowSet.

        Vector rowData = new Vector();

        for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) {
            rowData.add(DBTools.TST_TABLE_VALUES[0][i]);
        }

        tEnv.addObjRelation("CurrentRowData", rowData);

        // Adding relation for XRowUpdate
        XRow row = (XRow) UnoRuntime.queryInterface(XRow.class, oObj);
        tEnv.addObjRelation("XRowUpdate.XRow", row);

       
        tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "Cycle");
View Full Code Here

Examples of com.sun.star.sdbc.XRow

    protected String getContentList(XContent content) {
        XResultSet statRes = getStatResultSet(content);
        String ret = "";
        try {
            statRes.first();
            XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes);
            while(! statRes.isAfterLast()) {
                ret += "\n    " + row.getString(1);
                statRes.next();
            }
        } catch (com.sun.star.sdbc.SQLException e) {
            log.println("Exception occured:" + e);
        }
View Full Code Here

Examples of com.sun.star.sdbc.XRow

        return DynResSet;
    }

    protected XContent getSubContent(XContent content, String subName) {
        XResultSet statRes = getStatResultSet(content);
        XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes);
        XContentAccess contAcc = (XContentAccess)
            UnoRuntime.queryInterface(XContentAccess.class, statRes);
        XContent subContent = null;
        try {
            statRes.first();
            while(!statRes.isAfterLast()) {
                if ( subName.equals(row.getString(1)) ) {
                    subContent = contAcc.queryContent();
                }
                statRes.next();
            }
        } catch(com.sun.star.sdbc.SQLException e) {
View Full Code Here

Examples of com.sun.star.sdbc.XRow

    // --------------------------------------------------------------------------------------------------------
    void test3(XResultSet clone, XResultSet _resultSet)
    {
        try
        {
            final XRow _row = UnoRuntime.queryInterface( XRow.class, _resultSet );
            final XRow cloneRow = UnoRuntime.queryInterface( XRow.class, clone );
            for (int i = 1; i <= MAX_FETCH_ROWS; ++i)
            {
                final int calcPos = (MAX_TABLE_ROWS % i) + 1;
                if (clone.absolute(calcPos))
                {
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.