Announcement Announcement Module
Collapse
No announcement yet.
Warning jdbc template Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Warning jdbc template

    Hi,

    I have a POJO which can access my oracle database with jdbcTemplate and all worked fine until yesterday.
    Actually, when i made some request to my POJO, I notice that the jdbcTemplate throws a warning in the log :

    Code:
    [JdbcTemplate] SQLWarning ignored: java.sql.SQLWarning: Warning: execution completed with warning
    To know why I have this warning, I set the boolean "ignoreWarnings" to false like this :
    Code:
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    		<description>jdbc template</description>
    		<property name="dataSource">
    			<ref bean="dataSource"/>
    		</property>
    		<property name="ignoreWarnings">
    			<value>false</value>
    		</property>
    	</bean>
    and the when I launch my app, I have the following error :

    Code:
    org.springframework.jdbc.SQLWarningException&#58; Warning not ignored; nested exception is java.sql.SQLWarning&#58; Warning&#58; execution completed with warning
    java.sql.SQLWarning&#58; Warning&#58; execution completed with warning
    	at oracle.jdbc.dbaccess.DBError.addSqlWarning&#40;DBError.java&#58;950&#41;
    	at oracle.jdbc.dbaccess.DBError.addSqlWarning&#40;DBError.java&#58;1035&#41;
    	at oracle.jdbc.dbaccess.DBError.addSqlWarning&#40;DBError.java&#58;1062&#41;
    	at oracle.jdbc.ttc7.TTC7Protocol.doOall7&#40;TTC7Protocol.java&#58;1988&#41;
    	at oracle.jdbc.ttc7.TTC7Protocol.fetch&#40;TTC7Protocol.java&#58;1250&#41;
    	at oracle.jdbc.driver.OracleStatement.doExecuteQuery&#40;OracleStatement.java&#58;2529&#41;
    	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout&#40;OracleStatement.java&#58;2857&#41;
    	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate&#40;OraclePreparedStatement.java&#58;608&#41;
    	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery&#40;OraclePreparedStatement.java&#58;536&#41;
    	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement&#40;JdbcTemplate.java&#58;384&#41;
    	at org.springframework.jdbc.core.JdbcTemplate.execute&#40;JdbcTemplate.java&#58;333&#41;
    	at org.springframework.jdbc.core.JdbcTemplate.query&#40;JdbcTemplate.java&#58;374&#41;
    	at org.springframework.jdbc.core.JdbcTemplate.query&#40;JdbcTemplate.java&#58;410&#41;
    	at org.springframework.jdbc.core.JdbcTemplate.queryForList&#40;JdbcTemplate.java&#58;462&#41;
    	at statsretriever.business.quote.BusinessQuoteStatsDAOImpl.getBusinessFXAllQuoteStats&#40;BusinessQuoteStatsDAOImpl.java&#58;34&#41;
    	at statsretriever.business.quote.BusinessQuoteStats.getBusinessFXAllQuoteStats&#40;BusinessQuoteStats.java&#58;15&#41;
    	at statsretriever.client.TestBusinessQuoteRetriever.test&#40;TestBusinessQuoteRetriever.java&#58;36&#41;
    	at statsretriever.client.TestBusinessQuoteRetriever.main&#40;TestBusinessQuoteRetriever.java&#58;21&#41;
    Exception in thread "main"
    What would that mean :?: :?:

    thx in advance...

  • #2
    Please try catching the SQLWarningException and looking at the contained SQLException. It's possible that the useful information is in the chain contained in that SQLException.

    Comment


    • #3
      Hi,

      I follow your advice and I modified the code to catch the exception :

      Code:
      try &#123;
          myList = jt.queryForList&#40;query, param&#41;;
      &#125; catch &#40;SQLWarningException swe&#41; &#123;
          System.out.println&#40;"Exception is &#58;"&#41;;
          System.out.println&#40;swe&#41;;
          System.exit&#40;-1&#41;;
      &#125;
      Here is the full log :

      Code:
      Oct 5, 2004 2&#58;42&#58;02 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO&#58; Loading XML bean definitions from file &#91;C&#58;\eclipse_3.0\workspace\EBiz - StatsRetriever\config\retriever.business.quote.bean.config.xml&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO&#58; Loading XML bean definitions from file &#91;C&#58;\eclipse_3.0\workspace\EBiz - StatsRetriever\config\datasource.config.xml&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO&#58; Loading XML bean definitions from file &#91;C&#58;\eclipse_3.0\workspace\EBiz - StatsRetriever\config\include.properties.xml&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.context.support.AbstractXmlApplicationContext refreshBeanFactory
      INFO&#58; Bean factory for application context &#91;org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=30971263&#93;&#58; org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans &#91;businessQuoteRetriever,businessQuoteRetrieverDAO,dataSource,jdbcTemplate,propertyConfigurer&#93;; Root of BeanFactory hierarchy
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.context.support.AbstractApplicationContext refresh
      INFO&#58; 5 beans defined in ApplicationContext &#91;org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=30971263&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'propertyConfigurer'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.config.PropertyResourceConfigurer postProcessBeanFactory
      INFO&#58; Loading properties from file &#91;C&#58;\eclipse_3.0\workspace\EBiz - StatsRetriever\config\db.properties&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.context.support.AbstractApplicationContext initMessageSource
      INFO&#58; No MessageSource found for context &#91;org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=30971263&#93;&#58; using empty default
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster
      INFO&#58; No ApplicationEventMulticaster found for context &#91;org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=30971263&#93;&#58; using default
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.context.support.AbstractApplicationContext refreshListeners
      INFO&#58; Refreshing listeners
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
      INFO&#58; Pre-instantiating singletons in factory &#91;org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans &#91;businessQuoteRetriever,businessQuoteRetrieverDAO,dataSource,jdbcTemplate,propertyConfigurer&#93;; Root of BeanFactory hierarchy&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'businessQuoteRetriever'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'businessQuoteRetrieverDAO'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'jdbcTemplate'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'dataSource'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
      INFO&#58; Loaded JDBC driver&#58; oracle.jdbc.driver.OracleDriver
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory autowireConstructor
      INFO&#58; Bean 'dataSource' instantiated via constructor &#91;public org.springframework.jdbc.datasource.DriverManagerDataSource&#40;java.lang.String,java.lang.String,java.lang.String,java.lang.String&#41; throws org.springframework.jdbc.CannotGetJdbcConnectionException&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO&#58; Loading XML bean definitions from class path resource &#91;org/springframework/jdbc/support/sql-error-codes.xml&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'DB2'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'HSQL'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'MS-SQL'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'MySQL'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'Oracle'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'Informix'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'PostgreSQL'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.beans.factory.support.AbstractBeanFactory getBean
      INFO&#58; Creating shared instance of singleton bean 'Sybase'
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.jdbc.support.SQLErrorCodesFactory <init>
      INFO&#58; SQLErrorCodes loaded&#58; &#91;HSQL Database Engine, Oracle, Sybase SQL Server, Microsoft SQL Server, Informix Dynamic Server, PostgreSQL, DB2*, MySQL&#93;
      Oct 5, 2004 2&#58;42&#58;03 PM org.springframework.jdbc.support.SQLErrorCodesFactory getErrorCodes
      INFO&#58; Looking up default SQLErrorCodes for DataSource
      Oct 5, 2004 2&#58;42&#58;05 PM org.springframework.jdbc.support.SQLErrorCodesFactory getErrorCodes
      INFO&#58; Database Product Name is Oracle
      Oct 5, 2004 2&#58;42&#58;05 PM org.springframework.jdbc.support.SQLErrorCodesFactory getErrorCodes
      INFO&#58; Driver Version is 9.2.0.4.0
      Oct 5, 2004 2&#58;42&#58;05 PM org.springframework.core.CollectionFactory <clinit>
      INFO&#58; Using JDK 1.4 collections
      Exception is &#58;
      org.springframework.jdbc.SQLWarningException&#58; Warning not ignored; nested exception is java.sql.SQLWarning&#58; Warning&#58; execution completed with warning
      Hope someone can help me ...

      Comment

      Working...
      X