Package com.sun.star.sdbc

Examples of com.sun.star.sdbc.XConnection


               
            }
           
            XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface(
                                            XPropertySet.class, myForm);
            XConnection connection = (XConnection) AnyConverter.toObject(
                                 new Type(XConnection.class),
                                 xSetProp.getPropertyValue("ActiveConnection"));
            if (debug && connection == null){
                log.println("ERROR: could not get property 'ActiveConnection' from the XForm");
            }
           
            connection.close();
        } catch (Exception e) {
            log.println("ERROR: Can't close the connection: " + e.toString());
        }

        log.println("closing data source...");
View Full Code Here


    public void _ActiveConnection() {
        String propName = "ActiveConnection";
        try{

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

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

            log.println("set property to a new value...");
            oObj.setPropertyValue(propName, newValue);
           
            log.println("get the new value...");
            XConnection getValue = (XConnection) UnoRuntime.queryInterface(XConnection.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! " + e.toString());
            tRes.tested(propName, false);
View Full Code Here

    }

    public void _ActiveConnection() {
        boolean result = false;
        try {
            XConnection the_connection = null;
           
            try {
                the_connection = (XConnection) AnyConverter.toObject(
                                    new Type(XConnection.class),
                                    oObj.getPropertyValue("ActiveConnection"));
View Full Code Here

            log.println("Required object relation not found !") ;
            tRes.tested("connectWithCompletion()", false) ;
            return ;
        }

        XConnection con = null ;
        try {
            con = oObj.connectWithCompletion(handler) ;
        } catch (com.sun.star.sdbc.SQLException e) {
            throw new StatusException("Exception while method calling", e) ;
        }
View Full Code Here

    public void _connect() {
        boolean res = true;

        try {
            log.println("Trying to connect to " + url);
            XConnection connection = oObj.connect(url, info);
            res = (connection != null);
            log.println("Connected? " + res);
            log.println("Trying to connect to " + wrongUrl);
            connection = oObj.connect(wrongUrl, info);
            res &= (connection == null);
View Full Code Here

    public void _getConnection() {
        boolean res = true;

        try {
            log.println("getConnection(" + sdbcURL + ")");
            XConnection connection = oObj.getConnection(sdbcURL);
            res = connection != null;
        } catch(com.sun.star.sdbc.SQLException e) {
            log.println("Unexpected exception");
            e.printStackTrace(log);
            res = false;
View Full Code Here

    public void _ActiveConnection() {
        String propName = "ActiveConnection";
        try{

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

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

            log.println("set property to a new value...");
            oObj.setPropertyValue(propName, newValue);
           
            log.println("get the new value...");
            XConnection getValue = (XConnection) UnoRuntime.queryInterface(XConnection.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! " + e.toString());
            tRes.tested(propName, false);
View Full Code Here

    public void _getConnectionWithInfo() {
        boolean res = true;

        try {
            log.println("getConnectionWithInfo(" + jdbcURL + ")");
            XConnection connection =
                oObj.getConnectionWithInfo(jdbcURL, jdbcINFO);
            res = connection != null;
        } catch(com.sun.star.sdbc.SQLException e) {
            log.println("Unexpected exception");
            e.printStackTrace(log);
View Full Code Here

               
            }
           
            XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface(
                                            XPropertySet.class, myForm);
            XConnection connection = (XConnection) AnyConverter.toObject(
                                 new Type(XConnection.class),
                                 xSetProp.getPropertyValue("ActiveConnection"));
            if (debug && connection == null){
                log.println("ERROR: could not get property 'ActiveConnection' from the XForm");
            }
           
            connection.close();
        } catch (Exception e) {
            log.println("ERROR: Can't close the connection: " + e.toString());
        }

        log.println("closing data source...");
View Full Code Here

    public boolean getConnection(PropertyValue[] curproperties)
    {
        try
        {
            XConnection xConnection = null;
            if (Properties.hasPropertyValue(curproperties, "ActiveConnection"))
            {
                xConnection = UnoRuntime.queryInterface( XConnection.class, Properties.getPropertyValue( curproperties, "ActiveConnection" ) );
                if (xConnection != null)
                {
View Full Code Here

TOP

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

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.