zoukankan      html  css  js  c++  java
  • java.sql.SQLException: Could not commit with auto-commit set on

    This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.

    You can solve the problem, you have few options:

    1. Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
    2. Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.

      -Doracle.jdbc.autoCommitSpecCompliant=false

    3. Set Auto Commit off in Java/SQL:

      Java:

      conn.setAutoCommit(false);

      Oracle:

      SET AUTOCOMMIT OFF

    其中 第二个方法 被证实有效。

    参考 http://stackoverflow.com/questions/23953534/java-sql-sqlexception-could-not-commit-with-auto-commit-set-on-at-oracle-jdbc-d

  • 相关阅读:
    HDU 4608 I-number
    hdu 4607 ( Park Visit )
    ZROI十一集训Day2
    CodeForces1230
    模拟退火
    ZROI#1007
    ZROI#1006
    ZROI#1005
    ZROI#1004
    ZROI#962
  • 原文地址:https://www.cnblogs.com/SamuelSun/p/6645626.html
Copyright © 2011-2022 走看看