Package com.ziclix.python.sql

Examples of com.ziclix.python.sql.PyCursor


     * desired.  This allows additional functionality without losing any previous work or requiring any
     * complicated inheritance dependencies.
     */
    protected PyCursor cursor() {

        PyCursor cursor = this.connection.cursor(true);
        DataHandler origDataHandler = cursor.getDataHandler(), newDataHandler = null;

        if ((origDataHandler != null) && (this.dataHandler != null)) {
            Constructor cons = null;

            try {
                Class[] args = new Class[1];

                args[0] = DataHandler.class;
                cons = this.dataHandler.getConstructor(args);
            } catch (Exception e) {
                return cursor;
            }

            if (cons == null) {
                String msg = zxJDBC.getString("invalidCons", new Object[]{this.dataHandler.getName()});

                throw zxJDBC.makeException(msg);
            }

            try {
                Object[] args = new Object[1];

                args[0] = origDataHandler;
                newDataHandler = (DataHandler) cons.newInstance(args);
            } catch (Exception e) {
                return cursor;
            }

            if (newDataHandler != null) {
                cursor.__setattr__("datahandler", Py.java2py(newDataHandler));
            }
        }

        return cursor;
    }
View Full Code Here

TOP

Related Classes of com.ziclix.python.sql.PyCursor

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.