Announcement Announcement Module
No announcement yet.
Is there anyway I could disable SQLErrorCode translation? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there anyway I could disable SQLErrorCode translation?

    I am in an environment where XML parsing is screwed up. Is there anyway to disable the SQLErrorCode translation so I could at least use Spring JDBC support classes?

    I am doing a plugin for some 3rd party web app on WAS4.07 with UDB. If I don't have xml parser there, I got this:
    java.lang.NoClassDefFoundError: org/xml/sax/SAXException
    If I manually load them(xml-api.jar and xercesImpl.jar, then I got this:
    java.lang.ExceptionInInitializerError: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
    I also noticed that there are some SAX parser in the classpath of the web app, they somehow got screwed up. Besides, I have no control over this web app, I am just doing a plugin to go to UDB and get some data back.

    If I run my code in a seperate web app, I could use either Spring JDBC or Spring + iBATIS without any problem(WSAD5).


  • #2
    More exploring ...

    I went throught some of the source code to see whether I could get around the XML parsing problem. I am subclassing StoreProcedure, which has a JDBCTemplate that inherits from the class JdbcAccessor. If I manually set the exceptionTranslator field in JdbcAccessor with the class SQLStateSQLExceptionTranslator, which does not involve any XML, will JdbcAccessor's getExceptionTranslator() method return SQLStateSQLExceptionTranslator as expected?

    Thanks for any help.


    • #3
      Yes, it's quite valid to subclass jdbcTemplate to place around with the error code translator handling strategy...