Home Answers Viewqa Spring Spring JdbcTemplate and ResultSet is too slow..

 
 


Praveen
Spring JdbcTemplate and ResultSet is too slow..
2 Answer(s)      2 years and 4 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.

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 Pages:
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
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
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
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
Spring SimpleJdbcTemplate example
Spring SimpleJdbcTemplate example The SimpleJdbcTemplate has all the features of old JdbcTemplate and also support some features of  Java 5 i.e varargs... of JdbcTemplate. It has a simpler API and basically construct to support java
Spring SqlRowSet example
Spring SqlRowSet example The 'SqlRowSet' is used to handle the result fetched (very similar to ResultSet in core java). The main difference... as you are using with 'ResultSet' of core java. Given below is example
Spring JDBC Introduction
Spring JDBC Introduction The Spring's DAO(Data access object) make it easy... a brief introduction about Spring DAO JDBC. The following table  describe... care by Spring itself : Actions & responsibility Actions
multiple resultset in one resultset
multiple resultset in one resultset  how to retrive multiple resultsets in one resultset in java.? plz help
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
resultset metadta
resultset metadta  import java.sql.Connection; import... Employee Details Using resultset metadata: "); Connection con = null...(); ResultSet rs = st.executeQuery("SELECT * FROM employee
Spring MVC JDBC Example
Spring MVC JDBC Example To connect your Spring web application to the database you will have to create a DataSource and JdbcTemplate bean in your dispatcher... this dataSource object is required to create a JdbcTemplate object <bean id="
Spring Batch Example
about  batchUpdate()  method of class JdbcTemplate in Spring framework... Spring Batch Example     .../schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/util
An introduction to spring framework
complained that Spring is still too dependent on XML files. In this tutorial, any... SPRING Framework... AN INTRODUCTION...; (PUBLISHED IN DEVELOPER IQ - September2005) Spring is an open-source
Spring Validation
Spring Validation In this tutorial you will see an example of how to perform validation in spring-core. The spring provide Validator interface...() > 110) { e.rejectValue("age", "too old"); } System.out.println(e
The cursor in scrollable resultset
The cursor in scrollable resultset   How to move the cursor in scrollable resultset
Update a resultset programmatically
Update a resultset programmatically  How to update a resultset programmatically
function error too many input arguments
function error too many input arguments  function error too many input arguments
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  javascript browse image in spring progrme
spring
spring  Access JSP files in Spring
Spring Training
Spring Framework Training for the Developers   ...; Hands-On: 70%  The Spring Framework training is specially designed for the java programmers looking for a start up in the Spring Framework and use
Spring data source C3P0
Spring data source C3P0 In Spring , we connect to a database via data source. When we are using jdbc layer in Spring , JNDI provide us data source or you... jdbcTemplate. You can download c3p0 from below given link : http://sourceforge.net
spring
spring  sir how to access multiple jsp's in spring
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   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
JDBC using Spring framework - JDBC
JDBC using Spring framework  Hi, I am using Spring framework in my... a resultset. But when i try to retrieve the resultset, i get null values. Here's... ); return returnMap; And to get the resultset, I'm using a RowMapper class
spring
spring  sir can you explain me the flow of sample example by using spring? thanks
Spring
Spring  What is AOP concept in spring? How AOP concept differ from DI concept
Spring datasource DBCP
Spring data source DBCP In Spring , we connect to a database via data source. When we are using jdbc layer in Spring , JNDI provide us data source or you... CreateTable { private JdbcTemplate jdbcTemplate; public void setDataSource
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
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
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
How do i slow down the game (othello game)??
How do i slow down the game (othello game)??  Hello, I built an othello game that can be played by 2 humans , human and computer and two computers. Everything works correctly but the problem is that when 2 computers play
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
JSP - Resultset - JSP-Servlet
JSP - Resultset  hello sir, how can i count record in jsp. i use resultset in my jsp so in my login form how can i check the username and password is correct or not...?? please reply it's urgent.. thanks
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
spring
spring   package bean; public interface AccountsDAOI{ double... normally. i set the classpath=D:\java softwares\ST-IV\Spring\spring-framework-2 .5.1\dist\spring.jar;D:\java softwares\ST-IV\Spring\spring-framework-2.5.1\lib\c
Spring
the following links: http://www.roseindia.net/spring/ http://www.roseindia.net/spring
Spring
Spring  I understand spring as dependency injection. It can avoid object creating and can directly inject values. But i am comfusing that Dependency... are created. By the same way i want to know how spring injected property
Spring
the following links: http://www.roseindia.net/spring/ http://www.roseindia.net/spring/bean-init.shtml http://www.roseindia.net/spring/spring3/spring-3-hello
The Complete Spring Tutorial
about  batchUpdate()  method of class JdbcTemplate in Spring... The Complete Spring Tutorial In this tutorial I will show you how you can integrate struts, spring and hibernate in your web
spring - Spring
spring  what is the use of HashTable concept in spring
spring - Spring
spring  what is Session Factory in spring

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.