Results 1 to 3 of 3

Thread: Warning jdbc template

  1. #1
    Join Date
    Aug 2004
    Posts
    25

    Default 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...
    We are a football tribe!

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    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.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Aug 2004
    Posts
    25

    Default

    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 ...
    We are a football tribe!

Similar Threads

  1. Replies: 4
    Last Post: May 11th, 2012, 08:34 AM
  2. Spring-based Mail Template Framework
    By eisenb in forum Architecture
    Replies: 3
    Last Post: Dec 2nd, 2010, 07:24 AM
  3. Date format using JDBC Template
    By macmeureg in forum Data
    Replies: 5
    Last Post: Jun 29th, 2005, 10:18 AM
  4. which Template Engine
    By Gideon in forum Web
    Replies: 8
    Last Post: Nov 9th, 2004, 02:29 AM
  5. Replies: 3
    Last Post: Aug 15th, 2004, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •