1, oracle bulk insert
2, java.sql.SQLException: ORA-01745: invalid host / bind variable name (too much data when the solution appears to limit the number of insertion)
/**
* Specified size, separated collection, the collection is divided into a predetermined number of n press section
* @param <T>
*
* @param list
* @Param only
* @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: receive interrupt communication channel
Solution modify 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: a user request to cancel the current operation
Solution modify timeout