Package com.sun.star.sdbc

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



            tEnv.addObjRelation("XParameters.ParamValues", params) ;

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

            // Adding relation for XResultSetUpdate
            {
                final XResultSet xResSet = (XResultSet)
                    UnoRuntime.queryInterface(XResultSet.class, oObj) ;
                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() ;
View Full Code Here

    * 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

    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

        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

    public void _getWarnings() {
        final XRowUpdate xRowUpdate = (XRowUpdate)
            UnoRuntime.queryInterface(XRowUpdate.class, oObj);
        final XResultSetUpdate xResSetUpdate = (XResultSetUpdate)
            UnoRuntime.queryInterface(XResultSetUpdate.class, oObj);
        final XRow xRow = (XRow)
            UnoRuntime.queryInterface(XRow.class, oObj);
        if (xRowUpdate == null || xResSetUpdate == null || xRow == null) {
            throw new StatusException(Status.failed("Test must be modified"));
        }
        int oldVal = 0, newVal = 0;
        String valToSet = "9999999999999999";
        try {
            oldVal = xRow.getInt(DBTools.TST_INT);
            xRowUpdate.updateString(DBTools.TST_INT, valToSet);
            xResSetUpdate.updateRow();
            newVal = xRow.getInt(DBTools.TST_INT);
        } catch(com.sun.star.sdbc.SQLException e) {
            log.println("Unexpected SQL exception");
            e.printStackTrace(log);
            tRes.tested("getWarnings()", false);
            return;
View Full Code Here

    // --------------------------------------------------------------------------------------------------------
    void test3(XResultSet clone, XResultSet _resultSet)
    {
        try
        {
            final XRow _row = (XRow) UnoRuntime.queryInterface(XRow.class, _resultSet);
            final XRow cloneRow = (XRow) 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

    // --------------------------------------------------------------------------------------------------------
    void test4(XResultSet _resultSet)
    {
        try
        {
            final XRow _row = (XRow) UnoRuntime.queryInterface(XRow.class, _resultSet);
            _resultSet.beforeFirst();

            for (int i = 1; i <= MAX_TABLE_ROWS; ++i)
            {
                _resultSet.next();
                final XResultSet clone = createClone();
                final XRow cloneRow = (XRow) UnoRuntime.queryInterface(XRow.class, clone);
                final int calcPos = MAX_TABLE_ROWS - 1;
                if (calcPos != 0 && clone.absolute(calcPos))
                {
                    testPosition(clone, cloneRow, calcPos, "test4: clone");
                    testPosition(_resultSet, _row, i, "test4: rowset");
View Full Code Here

        createTestCase(true);
        // ensure that all records are known
        m_rowSetProperties.setPropertyValue("FetchSize", Integer.valueOf(10));

        final XResultSet clone = createClone();
        final XRow cloneRow = (XRow) UnoRuntime.queryInterface(XRow.class, clone);

        // .....................................................................................................
        // first check the basic scenario without the |moveToInsertRow| |moveToCurrentRow|, to ensure that
        // really those are broken, if at all
        m_resultSet.last();
View Full Code Here

            command.Argument = pArgs;

            com.sun.star.ucb.XCommandEnvironment env = null ;
            Object result =  xCmd.execute( command, 0, env ) ;

            XRow values = ( XRow ) UnoRuntime.queryInterface( XRow.class,
                result );
   
            xModel = ( XModel UnoRuntime.queryInterface( XModel.class,
                values.getObject( 1, null ) );
        }
        catch ( Exception ignore )
        {
            LogUtils.DEBUG("Failed to get model exception " + ignore );
         
View Full Code Here

TOP

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

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.