SQL state [72000]; error code [1013]; ORA-03111: 通信通道收到中断; java.sql.SQLException: ORA-01745: 无效的主机/绑

Posted 404code

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL state [72000]; error code [1013]; ORA-03111: 通信通道收到中断; java.sql.SQLException: ORA-01745: 无效的主机/绑相关的知识,希望对你有一定的参考价值。

1、oracle批量插入

2、java.sql.SQLException: ORA-01745: 无效的主机/绑定变量名(数据太多的时候出现解决方法限制条数插入)

 

/**
     * 按指定大小,分隔集合,将集合按规定个数分为n个部分
     * @param <T>
     * 
     * @param list
     * @param len
     * @return
     */
    public static <T> List<List<T>> splitList(List<T> list, int len) 
        
        if (list == null || list.isEmpty() || len < 1) 
            return Collections.emptyList();
        

        List<List<T>> result = new ArrayList<>();

        int size = list.size();
        int count = (size + len - 1) / len;

        for (int i = 0; i < count; i++) 
            List<T> subList = list.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1)));
            result.add(subList);
        
        
        return result;
    

 

3、SQL state [72000]; error code [1013]; ORA-03111: 通信通道收到中断

解决方法 修改timeout

<insert timeout="100" id="insertList" parameterType="java.util.List" >
        INSERT INTO deal_cp(
        id,
        batch_number,
        code,
        name,
        card,
        bank_card,
        money,
        dates,
        time,
        shop_name,
        batch_numbernew,
        visitor,
        visitor_card,
        end_date,
        moneynew,
        service_type,
        idnew,
        start_date,
        start_dates,
        start_time,
        end_dates,
        end_time,
        data_status,
        data_type,
        bank_ID
        )
        <foreach collection="list" item="dealCp" separator="union all">
              SELECT #dealCp.id,jdbcType=VARCHAR,
            #dealCp.batchNumber,jdbcType=VARCHAR,
            #dealCp.code,jdbcType=VARCHAR,
            #dealCp.name,jdbcType=VARCHAR,
            #dealCp.card,jdbcType=VARCHAR,
            #dealCp.bankCard,jdbcType=VARCHAR,
            #dealCp.money,jdbcType=VARCHAR,
            #dealCp.dates,jdbcType=VARCHAR,
            #dealCp.time,jdbcType=VARCHAR,
            #dealCp.shopName,jdbcType=VARCHAR,
            #dealCp.batchNumbernew,jdbcType=VARCHAR,
            #dealCp.visitor,jdbcType=VARCHAR,
            #dealCp.visitorCard,jdbcType=VARCHAR,
            #dealCp.endDate,jdbcType=DATE,
            #dealCp.moneynew,jdbcType=VARCHAR,
            #dealCp.serviceType,jdbcType=VARCHAR,
            #dealCp.idnew,jdbcType=VARCHAR,
            #dealCp.startDate,jdbcType=DATE,
            #dealCp.startDates,jdbcType=VARCHAR,
            #dealCp.startTime,jdbcType=VARCHAR,
            #dealCp.endDates,jdbcType=VARCHAR,
            #dealCp.endTime,jdbcType=VARCHAR,
            #dealCp.dataStatus,jdbcType=CHAR,
            #dealCp.dataType,jdbcType=CHAR,
            #dealCp.bankId,jdbcType=VARCHAR
            FROM dual
          </foreach>
    </insert>

 4、java.sql.SQLException: ORA-01013: 用户请求取消当前的操作
 解决方法 修改timeout

以上是关于SQL state [72000]; error code [1013]; ORA-03111: 通信通道收到中断; java.sql.SQLException: ORA-01745: 无效的主机/绑的主要内容,如果未能解决你的问题,请参考以下文章

[Error Code: 942, SQL State: 42000] ORA-00942: 表或视图不存在

Translating SQLException with SQL state '42000', error code '1064'错误

SP2-0642: SQL*Plus internal error state 2130, context 0:0:0

Inceptor [Code: 40000, SQL State: 42000] COMPILE FAILED: Internal error NullPointerException: [Erro

sqlplus连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0解决

出现错误 ORA-06502: PL/SQL: numeric or value error