Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

using a query() with RowMapper.

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using a "query() with RowMapper" and my code compiles but when i execute following output given in the place of data.



Oct 27, 2012 10:56:00 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader lo
adBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring.xml]
Oct 27, 2012 10:56:01 PM org.springframework.jdbc.datasource.DriverManagerDataSource setD
riverClassName
INFO: Loaded JDBC driver: oracle.jdbc.OracleDriver
Oct 27, 2012 10:56:01 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader lo
adBeanDefinitions
INFO: Loading XML bean definitions from class path resource [org/springframework/jdbc/sup
port/sql-error-codes.xml]
Oct 27, 2012 10:56:01 PM org.springframework.jdbc.support.SQLErrorCodesFactory <init>
INFO: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, Postg
reSQL, Sybase]
 
Ranch Hand
Posts: 32
Netbeans IDE Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are your other operation with database working ? Can you post codes for connection ?
 
Ritesh raushan
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kr. Pallav wrote:Are your other operation with database working ? Can you post codes for connection ?



please help.

//spring.xml

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">;

<beans>
<bean id="id1" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >

<property name="driverClassName" value="oracle.jdbc.OracleDriver" ></property>
<property name="url" value="jdbc : oracle:thin:@localhost:1521 : orcl"></property>
<property name="username" value="scott"></property>
<property name="password" value="tiger"></property>
</bean>

<bean id="id2" class="org.springframework.jdbc.core.JdbcTemplate" >
<property name="dataSource" ref="id1"/>
</bean>
<bean id="id3" class="Mybean">
<property name="jt" ref="id2"/>
</bean>
</beans>











 
Ranch Hand
Posts: 607
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You code looks ok at first glance. Can you post the error you are getting. Since spring is loading the error xml it indicates that it would some error in executing the SQL. Normally the next few lines tell what that error is ...
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic