Share on Google+Share on Google+

Praveen
Spring JdbcTemplate and ResultSet is too slow..
2 Answer(s)      6 years and 3 months ago
Posted in : Spring

Hi..

I am using spring jdbctemplate to fetch the records from oracle database.

But it is taking too long time to execute a simple select query. The query which is having 400 records is taking around 12 to 15 seconds. I am using json to retrieve that data.

But if i execute same query in toad, response time is less than 1 second. I am using java jdbcTemplate.query(sql, params, RowMapper object) and each record will have only 4 values.

I tried in following ways:

  • using simpleJdbcTemplate object
  • plain statement object
  • changing driver class from BasicDataSource to c3po in bean configuration.

But i cant able to reduce the response time to 2 seconds less atleast.

Please help which will be greatly appreciated...

Thank you.

Ads

View Answers

December 31, 2010 at 6:42 PM


Hi,

Try to create indexes on your tables. I think your database table does not contains required indexes.

Thanks



January 7, 2011 at 6:48 PM


Thanks for your reply. It resolved now. Because database and application are different servers.










Related Tutorials/Questions & Answers:
Spring JdbcTemplate and ResultSet is too slow..
Spring JdbcTemplate and ResultSet is too slow..  Hi.. I am using spring jdbctemplate to fetch the records from oracle database. But it is taking too long time to execute a simple select query. The query which is having 400
What is Spring's JdbcTemplate ?
What is Spring's JdbcTemplate ?  Hi, What is Spring's JdbcTemplate ? Thanks
Advertisements
ResultSet
ResultSet   What is a ResultSet
ResultSet
ResultSet  What is a ResultSet
ResultSet
ResultSet  I want to retrieve data of unknown datatype from database.how to do it using resultset or Resultsetmetadata.Can you please tell me what... = con.createStatement(); ResultSet rs = st.executeQuery
JDBCTemplate BatchUpdate() example not working
JDBCTemplate BatchUpdate() example not working  Hi, I tried the JDBCTemplate BatchUpdate example, with IBM DB2 database. I updated the dataSource bean values accordingly. When I try, the program runs fine, however the database
jdbctemplate select query
Spring 'jdbctemplate' insert example The 'JdbcTemplate' class is the core class in Spring JDBC core package. This class is responsible... procedure calls, perform iteration over ResultSet & fetching of returned parameter
jdbctemplate batchUpdate example
jdbctemplate batchUpdate example The performance of JDBC driver improves.... This Section contains the example of batch update using 'jdbcTemplate'. Two... batchUpdate { private JdbcTemplate jdbcTemplate; public void setDataSource
Spring Batch Example
about  batchUpdate()  method of class JdbcTemplate in Spring framework... Spring Batch Example      ...://www.springframework.org/schema/beans/spring-beans-2.0.xsd http
multiple resultset in one resultset
multiple resultset in one resultset  how to retrive multiple resultsets in one resultset in java.? plz help
SQL function extremely slow from 5.5
SQL function extremely slow from 5.5  SQL function extremely slow from 5.5
resultset metadta
resultset metadta  import java.sql.Connection; import... Employee Details Using resultset metadata: "); Connection con = null...(); ResultSet rs = st.executeQuery("SELECT * FROM employee
Why Dose Hibernate Run Very Slow?
Why Dose Hibernate Run Very Slow?  I use Hibernate in netbean 6.9.1, when I run by F6 of netbean, Hibernate run very slow, it run some row INFO.... in GlassFish of netbean, web of me run very slow. I have configure Hibernate
function error too many input arguments
function error too many input arguments  function error too many input arguments
Update a resultset programmatically
Update a resultset programmatically  How to update a resultset programmatically
The cursor in scrollable resultset
The cursor in scrollable resultset   How to move the cursor in scrollable resultset
spring
spring   hi how can we make spring bean as prototype how can we load applicationcontext in spring what is dependency injection
spring
spring  how to upgrade from struts2 to spring
spring
spring  Access JSP files in Spring
spring
spring  javascript browse image in spring progrme
Resultset - JSP-Servlet
Resultset  I am writing while(rs.next){} but if resultset is null then it cannot enter in while block. I want,if resultset is null then it will enter into the while block.  Hi friend, A ResultSet object
spring
spring  sir how to access multiple jsp's in spring
SQL exception, Exhausted ResultSet
SQL exception, Exhausted ResultSet  javax.servlet.ServletException: java.sql.SQLException: Exhausted Resultset iam getting this error messege whenever i run my code. what would be the possible reasons
resultset problem - JSP-Servlet
resultset problem  hi I have one problem with resultset? ResultSet rs=st.execute("select subjname,staffname from staffdetails"); while... is java.sql.SQLException: Operation not allowed after ResultSet closed how
spring
spring   i am a beginner in java.. but i have to learn spring framework.. i know the core java concepts with some J2EE knowledge..can i learn spring without knowing anything about struts
JTable populate with resultset.
JTable populate with resultset.  How to diplay data of resultset...) JTable(Vector data, Vector columneNames) Here is a JTable populate with resultset...(); ResultSet resultSet = statement.executeQuery(sql
Spring
Spring  What is AOP concept in spring? How AOP concept differ from DI concept
spring
spring  sir can you explain me the flow of sample example by using spring? thanks
Resultset Issue in SQL
Resultset Issue in SQL  when i call rs.next() in my code it is returning false, though im having valid query to execute and fetch a row from database.how can i resolve this issue. My code is: SELECT JOBDESCRIPTION,CATEGORY
Resultset with one to many relationship
Resultset with one to many relationship   Suppose there are 5 tables in database named A,B,C,D and E. A has one to many relationship with B,C,D and D... populate my bean classes from resultset without using hibernate, so
large resultset values - SQL
large resultset values  i have one query which will bring more than one lakh records from database(total records are abt 3 crores). While getting the details i'm getting error like
Tutorials   
Java Spring Hibernate Struts Training spring inteview question You Spring Project is not running java lang incompatibleclasschangeerror quartz spring - Error resolved exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined The import javax.validation cannot be resolved java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence Solving java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean issue What is the maven dependency for spring batch? Hibernate Session Attribute java.lang.ClassNotFoundException: org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DriverManagerDataSource Testing spring with junit and mock testing in Spring MVC, i would like to download my Mysql database table in pdf,msword,excel formats. java.lang.NoClassDefFoundError: org/hibernate/engine/FilterDefinition error package org.springframework.scheduling.quartz does not exist jquery dependency dropdown box in spring hibernate my sql Server side validation on dynamically generated fields from more than one table on spring framework. What are the new features of Spring 4.1? Append Arguments to the URL quartz schedular in spring mvc Where to download spring framework zip file? Integrating spring 4 with hibernate 4 Learn spring Multiple files upload code using spring mvc 2.0 with xml configuration without using annotations Spring 4 features I need Spring 2.5 example. Please point me towards a good Spring transactional tutorial Could anyone point me towards some good Spring tutorials, Please? What is Spring framework? Spring and hibernate based Online Shopping project with source code How to populate collection like map with annotation in mybatis? Spring Abstraction with Redis Spring framework How to insert and retreive an image in mysql database using spring mvc framework??? CRUD operations in spring mvc 2.5 meenakshi Meenakshi how many scenarios is having to developing web based application by using spring mvc. getting voucherPin parent and child dropdown Spring 3 Spring 3 MVC Login Form Example with Database MySql What is Spring Integration? How to configure Spring using Annotation What is Spring IOC Container ? What is difference between singleton and prototype bean? What are the differences between EJB and Spring What is Spring's JdbcTemplate ?

Ads

 
Advertisement null

Ads