• mybatis BaseMapper int insert(T entity) 方法异常


    //该方法报错,猜测的jdbc jar包有bug,属性超过8个会报数组溢出异常,因为是使用属性下标取值,不是根据属性名称取值
    // 使用ojdbc6 11.2.0.2.0,估计jar包有问题

    // 解决办法1:实体类实现序列话接口Serializable,并生成序列化id
    
    
    // 解决办法2:改用xml写sql语句,指定jdbcType,防止属性为空时不能识别类型报错
    int insert(T entity);

    Caused by: java.lang.ArrayIndexOutOfBoundsException: 13
    at oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:950) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:623) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:1212) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.T4CPreparedStatement.<init>(T4CPreparedStatement.java:28) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.T4CDriverExtension.allocatePreparedStatement(T4CDriverExtension.java:68) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3140) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:6022) ~[ojdbc6-11.2.0.1.0.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:685) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:343) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:681) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:962) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:176) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:681) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:366) ~[druid-1.1.10.jar:1.1.10]
    at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:485) ~[druid-1.1.10.jar:1.1.10]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_251]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_251]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_251]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_251]
    at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:55) ~[mybatis-3.5.0.jar:3.5.0]
    at com.sun.proxy.$Proxy235.prepareStatement(Unknown Source) ~[na:na]
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:83) ~[mybatis-3.5.0.jar:3.5.0]
    at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88) ~[mybatis-3.5.0.jar:3.5.0]
    ... 98 common frames omitted

  • 相关阅读:
    App分享微信小程序
    PHP-FFMpeg 操作视频/音频文件 (转)
    用户画像
    phpcms中的RBAC权限系统
    PHPExcel生成excel
    OPNET中节点模型中包流的索引号的含义
    删除opnet之前保存或打开的目录后每次打开总会提示warning
    opnet 的学习方法有感
    win10:两款轻量级美化软件使用技巧(StartlsBack++与RocketDock)
    任务栏透明
  • 原文地址:https://www.cnblogs.com/shihx/p/13091422.html
Copyright © 2020-2023  润新知