Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
//package io.lightlink.sql;
/*
* #%L
* lightlink-core
* %%
* Copyright (C) 2015 Vitaliy Shevchuk
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
//
//import io.lightlink.sql.dbridge.config.ArgDescr;
//import io.lightlink.sql.dbridge.config.ProcDesr;
//import oracle.jdbc.OracleCallableStatement;
//import oracle.jdbc.OracleConnection;
//import oracle.jdbc.OracleTypes;
//import oracle.sql.ARRAY;
//import oracle.sql.ArrayDescriptor;
//import oracle.sql.STRUCT;
//import oracle.sql.StructDescriptor;
//import org.apache.commons.beanutils.BeanMap;
//import org.apache.commons.collections.map.CaseInsensitiveMap;
//import org.springframework.jdbc.support.nativejdbc.OracleJdbc4NativeJdbcExtractor;
//import org.springframework.stereotype.Component;
//
//import java.sql.*;
//import java.sql.Date;
//import java.util.*;
//
//@Component
//public class OracleProcExecutor extends AbstractProcExecutor {
//
//
// public static OracleJdbc4NativeJdbcExtractor oracleJdbc4NativeJdbcExtractor;
//
// @Override
// protected String prepareSQL(ProcDesr proc) {
// StringBuilder sql = new StringBuilder();
//
// sql.append("{call ").append(proc.getName()).append("(");
//
// for (ArgDescr arg : proc.getArgs()) {
// sql.append(arg.getName()).append(" => ?,");
// }
//
// sql.setLength(sql.length() - 1);
// sql.append(")}");
//
// return sql.toString();
// }
//
// @Override
// protected boolean registerOutParams(CallableStatement cs, int pos, ArgDescr arg, Map params) throws SQLException {
//
// boolean processes = super.registerOutParams(cs, pos, arg, params);
// if (processes) {
// return true;
// }
//
// OracleCallableStatement callStatement = getOracleCallableStatement(cs);
//
// if (arg.isStringArray() || arg.isNumericArray()) {
// callStatement.registerOutParameter(pos, OracleTypes.ARRAY, arg.getType());
// } else if (arg.isStruct()) {
// callStatement.registerOutParameter(pos, OracleTypes.STRUCT, arg.getType());
// } else if (arg.isTimestampTZ()) {
// callStatement.registerOutParameter(pos, OracleTypes.TIMESTAMPTZ);
// } else if (arg.isCursor()) {
// callStatement.registerOutParameter(pos, OracleTypes.CURSOR);
// } else if (arg.isStructArray()) {
// callStatement.registerOutParameter(pos, OracleTypes.ARRAY, arg.getType());
// } else {
// throw new IllegalArgumentException("Unrecognised out parameter " + arg);
// }
// return true;
// }
//
// @Override
// protected void loadOutData(CallableStatement cs, ProcDesr proc, HashMap res)
// throws SQLException {
//
// super.loadOutData(cs, proc, res);
//
// OracleCallableStatement callableStatement = getOracleCallableStatement(cs);
//
// int pos = 0;
// for (ArgDescr arg : proc.getArgs()) {
// pos++;
//
// if (arg.isOut()) {
// Object value;
//
// if (arg.isStringArray() || arg.isNumericArray()) {
// value = callableStatement.getArray(pos).getArray();
// } else if (arg.isStructArray()) {
// List