• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using a query() with RowMapper.

 
Ritesh raushan
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]
 
Kr. Pallav
Ranch Hand
Posts: 32
Eclipse IDE Netbeans 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>











 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • 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 ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic