aspose file tools*
The moose likes Spring and the fly likes using a query() with RowMapper. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "using a query() with RowMapper." Watch "using a query() with RowMapper." New topic
Author

using a query() with RowMapper.

Ritesh raushan
Ranch Hand

Joined: Aug 29, 2012
Posts: 100
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

Joined: Mar 06, 2010
Posts: 32

Are your other operation with database working ? Can you post codes for connection ?


~|>@//@\/~
Kumar Pallav
-------------------
SCJP 5: 86 %, SCWCD: 91%
Ritesh raushan
Ranch Hand

Joined: Aug 29, 2012
Posts: 100
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

Joined: Feb 08, 2009
Posts: 605

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 ...


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: using a query() with RowMapper.