Uploaded image for project: 'S2Dao'
  1. S2Dao
  2. DAO-31

Oracle JDBC使用時、QUERYアノテーションのBEGINコメントでSQLRuntimeExceptionが発生しないようにしました。

XMLWordPrintable

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major Major
    • 1.0.46
    • Affects Version/s: 1.0.36
    • Component/s: s2dao
    • None
    • Environment:
      Oracle JDBC Driver Ver.10.2.0.1.0 (file name : ojdbc14.jar)

      Oracle JDBC Driverを使用した場合、QUERYアノテーションにBEGINコメントを記述すると下記の例外が発生する。
      ※HSQLDB JDBC Driverを使用した場合、正常終了する(例外は発生しない)。

      例:org.seasar.dao.impl.DaoMetaDataImplTest#testStartsWithBeginComment 実行時。

      org.seasar.framework.exception.SQLRuntimeException: [ESSR0071]SQLで例外(ErrorCode=933, SQLState=42000)が発生しました。理由はorg.seasar.framework.exception.SSQLException: [ESSR0072]SQLで例外(SQL=[SELECT EMP.empno, EMP.ename, EMP.job, EMP.mgr, EMP.hiredate, EMP.sal, EMP.comm, EMP.deptno, EMP.tstamp, department.deptno AS deptno_0, department.dname AS dname_0, department.loc AS loc_0, department.versionno AS versionno_0 FROM EMP, DEPT department WHERE EMP.deptno = department.deptno(+) WHERE ename = ? ], ErrorCode=933, SQLState=42000)が発生しました
      at org.seasar.framework.util.PreparedStatementUtil.executeQuery(PreparedStatementUtil.java:37)
      at org.seasar.extension.jdbc.impl.BasicResultSetFactory.createResultSet(BasicResultSetFactory.java:36)
      at org.seasar.extension.jdbc.impl.BasicSelectHandler.createResultSet(BasicSelectHandler.java:173)
      at org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler.java:162)
      at org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler.java:135)
      at org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler.java:120)
      at org.seasar.dao.impl.SelectDynamicCommand.execute(SelectDynamicCommand.java:55)
      at org.seasar.dao.impl.DaoMetaDataImplTest.testStartsWithBeginComment(DaoMetaDataImplTest.java:490)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at org.seasar.framework.unit.S2FrameworkTestCase.doRunTest(S2FrameworkTestCase.java:248)
      at org.seasar.extension.unit.S2TestCase.doRunTest(S2TestCase.java:92)
      at org.seasar.framework.unit.S2FrameworkTestCase.runBare(S2FrameworkTestCase.java:154)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.seasar.framework.exception.SSQLException: [ESSR0072]SQLで例外(SQL=[SELECT EMP.empno, EMP.ename, EMP.job, EMP.mgr, EMP.hiredate, EMP.sal, EMP.comm, EMP.deptno, EMP.tstamp, department.deptno AS deptno_0, department.dname AS dname_0, department.loc AS loc_0, department.versionno AS versionno_0 FROM EMP, DEPT department WHERE EMP.deptno = department.deptno(+) WHERE ename = ? ], ErrorCode=933, SQLState=42000)が発生しました
      at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl$PreparedStatementWrapper.wrapException(ConnectionWrapperImpl.java:557)
      at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl$PreparedStatementWrapper.wrapException(ConnectionWrapperImpl.java:552)
      at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl$PreparedStatementWrapper.executeQuery(ConnectionWrapperImpl.java:568)
      at org.seasar.framework.util.PreparedStatementUtil.executeQuery(PreparedStatementUtil.java:35)
      ... 24 more
      Caused by: java.sql.SQLException: ORA-00933: SQLコマンドが正しく終了されていません。

      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
      at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)
      at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)
      at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
      at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
      at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl$PreparedStatementWrapper.executeQuery(ConnectionWrapperImpl.java:566)
      ... 25 more

            Assignee:
            taedium taedium
            Reporter:
            rmiyax rmiyax
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: