Examples of XResultSet


Examples of com.sun.star.sdbc.XResultSet

        } catch (SQLException e) {
            log.println("Unexpected SQL Exception occured:" + e) ;
            res = false;
        }

        XResultSet resSet = (XResultSet)
            UnoRuntime.queryInterface(XResultSet.class, oObj);

        if (resSet != null) {
            try {
                resSet.first();
                log.println("Expected SQLException not occured !");
                res = false;
            } catch(SQLException e) {
                log.println("Expected SQLException occured");
                res = true;
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

    public int deleteAllRows(XConnection con, String table)
        throws com.sun.star.sdbc.SQLException {

        XStatement stat = con.createStatement() ;

        XResultSet set = stat.executeQuery("SELECT * FROM " + table) ;

        XResultSetUpdate updt = (XResultSetUpdate) UnoRuntime.queryInterface
            (XResultSetUpdate.class, set) ;

        int count = 0 ;
        set.last() ;
        int rowNum = set.getRow() ;
        set.first() ;

        for (int i = 0; i < rowNum; i++) {
            updt.deleteRow() ;
            set.next() ;
            count ++ ;
        }

        XCloseable xClose = (XCloseable) UnoRuntime.queryInterface
            (XCloseable.class, set) ;
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

        int streamLength)
        throws com.sun.star.sdbc.SQLException {

        XStatement stat = con.createStatement() ;

        XResultSet set = stat.executeQuery("SELECT * FROM " + table) ;

        XResultSetUpdate updt = (XResultSetUpdate) UnoRuntime.queryInterface
            (XResultSetUpdate.class, set) ;

        XRowUpdate rowUpdt = (XRowUpdate) UnoRuntime.queryInterface
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

    public void _ResultSet() {
        String propName = "ResultSet";
        try{

            log.println("try to get value from property...");
            XResultSet oldValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName));

            log.println("try to get value from object relation...");
            XResultSet newValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,tEnv.getObjRelation("MailMerge.XResultSet"));

            log.println("set property to a new value...");
            oObj.setPropertyValue(propName, newValue);
           
            log.println("get the new value...");
            XResultSet getValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName));

            tRes.tested(propName, this.compare(newValue, getValue));
        } catch (com.sun.star.beans.PropertyVetoException e){
            log.println("could not set property '"+ propName +"' to a new value!");
            tRes.tested(propName, false);
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

    public String[] getExportedKeys(){
    String[] sReferencedTableNames = new String[]{};   
    try {
        String[] sTableNames = super.getCommandMetaData().getTableNames();
        Vector aReferencedTableVector = new Vector();
        XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getExportedKeys((getCatalogName(this)), getSchemaName(), getTableName());
        XRow 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());
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

   
    public String[][] getImportedKeyColumns(String _sreferencedtablename){
    String[][] sKeyColumnNames = new String[][]{};
    try {
        CommandName oLocCommandName = new CommandName(super.getCommandMetaData(), _sreferencedtablename);
        XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getImportedKeys(getCatalogName(oLocCommandName),oLocCommandName.getSchemaName(), _sreferencedtablename);
        XRow 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.supportsCatalogsInDataManipulation())
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

        return sColValues;
    }

    public String[] getCatalogNames(){
        try {
            XResultSet xResultSet = xDBMetaData.getCatalogs();
            return StringsFromResultSet(xResultSet, 1);
        } catch (SQLException e) {
            e.printStackTrace(System.out);
            return null;
        }
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

    }


    public String[] getSchemaNames(){
        try {
            XResultSet xResultSet = xDBMetaData.getSchemas();
            return StringsFromResultSet(xResultSet, 1);
        } catch (SQLException e) {
            e.printStackTrace(System.out);
            return null;
        }
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

    }

    /* ------------------------------------------------------------------ */
    private void moveToFirst() throws com.sun.star.uno.Exception, java.lang.Exception
    {
        XResultSet xResultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
        xResultSet.first( );
    }
View Full Code Here

Examples of com.sun.star.sdbc.XResultSet

    }

    /* ------------------------------------------------------------------ */
    private void moveToNext() throws com.sun.star.uno.Exception, java.lang.Exception
    {
        XResultSet xResultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
        xResultSet.next( );
    }
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.