jfinal save 超过9个字段以上就会出现数组下标越界

代码: 

  public static void main(String[] args) {
        C3p0Plugin c3p0Plugin = new C3p0Plugin("jdbc:oracle:thin:@192.168.101.10:1521:oratm","imp_zyk", "11111111");
        c3p0Plugin.setDriverClass("oracle.jdbc.driver.OracleDriver");
        c3p0Plugin.setMaxPoolSize(64);
        c3p0Plugin.setMinPoolSize(16);
        c3p0Plugin.start();
        ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
         arp.setDialect(new OracleDialect());   
        arp.setContainerFactory(new CaseInsensitiveContainerFactory());  
        arp.addMapping("userinformation", userinformation.class);
        arp.start();
        userinformation.dao.set("id", "8");
        userinformation.dao.set("USERNAME", "2");
        userinformation.dao.set("CARDNO","3");
        userinformation.dao.set("CARDADDRESS","4");
        userinformation.dao.set("PHOTOURL1", "5");
        userinformation.dao.set("PHOTOURL2","6");
        userinformation.dao.set("PHOTOURL3","7");
        userinformation.dao.set("PHOTOBASE1","8");
        userinformation.dao.set("PHOTOBASE2", "9");
        userinformation.dao.set("PHOTOBASE3","10");
        userinformation.dao.set("TBORDERNO","11");
//        
//        
        
        Boolean b = userinformation.dao.save();
         System.out.println(b);
    }






异常

Exception in thread "main" com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.ArrayIndexOutOfBoundsException: 11
    at com.jfinal.plugin.activerecord.Model.save(Model.java:324)
    at DataBase.zwlutil.main(zwlutil.java:67)
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.ArrayIndexOutOfBoundsException: 11
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:74)
    at com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable(NewPooledConnection.java:505)
    at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:584)
    at com.jfinal.plugin.activerecord.Model.save(Model.java:314)
    ... 1 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 11
    at oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:950)
    at oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:623)
    at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:1212)
    at oracle.jdbc.driver.T4CPreparedStatement.<init>(T4CPreparedStatement.java:28)
    at oracle.jdbc.driver.T4CDriverExtension.allocatePreparedStatement(T4CDriverExtension.java:68)
    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3140)
    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042)
    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:6022)
    at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:567)
    ... 2 more

评论区

happyboy

2016-12-08 10:37

让showsql=true,看一下sql是不是有问题。

JFinal

2016-12-08 11:38

不用再找原因了,历史上大致有四五个人碰到过这个问题,是因为 oracle 驱动的 bug 引发的,换个 oracle jar 包即可打完收枪

泪三国云无痕

2016-12-09 10:49

嗯嗯,换个jar包,我前段时间也是这个问题,然后用同事的jar包覆盖过来就没事了

JFinal

2016-12-09 11:08

@泪三国云无痕 jfinal 代码质量要求是极高的,oracle 都可能出的这种 bug,jfinal 决对不会出这种低级 bug

miracle佐

2018-04-24 15:02

时隔一年多也遇到了同样的问题,替换oracle驱动的jar包解决问题。波总,我也加入了历史上五六个人的行列,哈哈。

土龙

2018-07-25 10:08

嗯嗯,换个jar包,我也遇到了,看来不止五六人了

JFinal

2018-07-25 11:25

@miracle佐 @土龙 又来两个踩坑的,oracle 作为这么成熟的商业公司出现这种 bug 实属不应该

fenghai2012

2018-09-08 16:53

我也来踩坑了,oracle这种bug都有,差点冤枉了jfinal

热门反馈

扫码入社