Package org.apache.ode.bpel.extvar.jdbc.DbExternalVariable

Examples of org.apache.ode.bpel.extvar.jdbc.DbExternalVariable.RowVal


        EVarId evarId = new EVarId(newval.locator.pid, newval.locator.varId);
        DbExternalVariable evar = _vars.get(evarId);
        if (evar == null)
            throw new ExternalVariableModuleException("No such variable. "); // todo

        RowVal val = evar.parseXmlRow(evar.new RowVal(), (Element) newval.value);
        RowKey key = evar.keyFromLocator(newval.locator);

        if (key.isComplete() && evar._initType == InitType.delete_insert) {
            // do delete...
            // TODO
View Full Code Here


        if (evar == null)
            throw new ExternalVariableModuleException("No such variable. "); // todo
       
        Element val;
        try {
            RowVal rowval = execSelect(evar, locator);
            val = evar.renderXmlRow(rowval);
        } catch (SQLException se) {
            throw new ExternalVariableModuleException("SQL Error.", se);
        }
View Full Code Here

       
        if (!rowkey.isComplete()) {
          throw new IncompleteKeyException(rowkey.getMissing());
        }
       
        RowVal ret = dbev.new RowVal();
        Connection conn = dbev.dataSource.getConnection();
        try {
            PreparedStatement stmt = conn.prepareStatement(dbev.select);
            int idx = 1;
            for (Object k : rowkey)
                stmt.setObject(idx++, k);

            ResultSet rs = stmt.executeQuery();
            try {
                if (rs.next()) {
                    for (Column cr : dbev._columns)
                        ret.set(cr.idx,rs.getObject(cr.idx+1));

                } else
                    return null;
            } finally {
                rs.close();
View Full Code Here

        DbExternalVariable evar = _vars.get(evarId);
        if (evar == null)
            throw new ExternalVariableModuleException("No such variable. "); // todo

        RowKey key = evar.keyFromLocator(newval.locator);
        RowVal val = evar.parseXmlRow(evar.new RowVal(), (Element) newval.value);
        if (__log.isDebugEnabled())
            __log.debug("JdbcExternalVariable.writeValue() RowKey: " + key + " RowVal: " + val);

        if (!key.missingValues() && evar._initType == InitType.delete_insert) {
            // do delete...
View Full Code Here

        if (evar == null)
            throw new ExternalVariableModuleException("No such variable: "+evarId);
       
        Element val;
        try {
            RowVal rowval = execSelect(evar, locator);
            val = evar.renderXmlRow(locator, varType, rowval);
        } catch (SQLException se) {
            throw new ExternalVariableModuleException("SQL Error.", se);
        }
View Full Code Here

       
        if (rowkey.missingValues()) {
            throw new IncompleteKeyException(rowkey.getMissing());
        }
       
        RowVal ret = dbev.new RowVal();
        Connection conn = dbev.dataSource.getConnection();
        try {
            if (__log.isDebugEnabled()) __log.debug("Prepare statement: " + dbev.select);
            PreparedStatement stmt = conn.prepareStatement(dbev.select);
            int idx = 1;
            for (Object k : rowkey) {
                if (__log.isDebugEnabled()) __log.debug("Set key parameter "+idx+": "+k);
                stmt.setObject(idx++, k);
            }

            ResultSet rs = stmt.executeQuery();
            try {
                if (rs.next()) {
                    for (Column cr : dbev._columns)  {
                        Object val = rs.getObject(cr.idx+1);
                        if (__log.isDebugEnabled()) __log.debug("Result column index "+cr.idx+": "+val);
                        ret.set(cr.idx,val);
                    }
                } else
                    return null;
            } finally {
                rs.close();
View Full Code Here

        DbExternalVariable evar = _vars.get(evarId);
        if (evar == null)
            throw new ExternalVariableModuleException("No such variable. "); // todo

        RowKey key = evar.keyFromLocator(newval.locator);
        RowVal val = evar.parseXmlRow(evar.new RowVal(), (Element) newval.value);
        if (__log.isDebugEnabled())
            __log.debug("JdbcExternalVariable.writeValue() RowKey: " + key + " RowVal: " + val);

        if (!key.missingValues() && evar._initType == InitType.delete_insert) {
            // do delete...
View Full Code Here

        if (evar == null)
            throw new ExternalVariableModuleException("No such variable: "+evarId);
       
        Element val;
        try {
            RowVal rowval = execSelect(evar, locator);
            val = evar.renderXmlRow(locator, varType, rowval);
        } catch (SQLException se) {
            throw new ExternalVariableModuleException("SQL Error.", se);
        }
View Full Code Here

       
        if (rowkey.missingValues()) {
            throw new IncompleteKeyException(rowkey.getMissing());
        }
       
        RowVal ret = dbev.new RowVal();
        Connection conn = dbev.dataSource.getConnection();
        PreparedStatement stmt = null;
        try {
            if (__log.isDebugEnabled()) __log.debug("Prepare statement: " + dbev.select);
            stmt = conn.prepareStatement(dbev.select);
            int idx = 1;
            for (Object k : rowkey) {
                if (__log.isDebugEnabled()) __log.debug("Set key parameter "+idx+": "+k);
                stmt.setObject(idx++, k);
            }

            ResultSet rs = stmt.executeQuery();
            try {
                if (rs.next()) {
                    for (Column c : dbev._columns)  {
                        Object val;
                        int i = c.idx+1;
                        if (c.isDate()) val = rs.getDate(i);
                        else if (c.isTimeStamp()) val = rs.getTimestamp(i);
                        else if (c.isTime()) val = rs.getTime(i);
                        else if (c.isInteger()) val = new Long(rs.getLong(i));
                        else if (c.isReal()) val = new Double(rs.getDouble(i));
                        else if (c.isBoolean()) val = new Boolean(rs.getBoolean(i));
                        else val = rs.getObject(i);
                        if (__log.isDebugEnabled()) __log.debug("Result column index "+c.idx+": "+val);
                        ret.set(c.idx,val);
                    }
                } else
                    return null;
            } finally {
                rs.close();
View Full Code Here

        DbExternalVariable evar = _vars.get(evarId);
        if (evar == null)
            throw new ExternalVariableModuleException("No such variable. "); // todo

        RowKey key = evar.keyFromLocator(newval.locator);
        RowVal val = evar.parseXmlRow(evar.new RowVal(), (Element) newval.value);
        if (__log.isDebugEnabled())
            __log.debug("JdbcExternalVariable.writeValue() RowKey: " + key + " RowVal: " + val);

        if (!key.missingValues() && evar._initType == InitType.delete_insert) {
            // do delete...
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.extvar.jdbc.DbExternalVariable.RowVal

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.