• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

database accessing time

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all

I am accessing the table to display its contents using JSP and JDBC
That table is having more than 400 records and it takes too much time to load.The table is having only two columns and it is a look up table.

The code is something like this
Statement stmt = conn.createStatement();
ResultSet rst=stmt.executeQuery("SELECT * FROM lookup");
while(rst.next())
{
City= rst.getString(1);
%>
<tr>
<td > <h4><%out.println(City);%></h4></td>
<%
Pop= rst.getString(2);
%>
<td > <%out.println(Pop);%></h4></td>
</tr>

Can anyone suggest a suitable method to reduce the accessing time

Sankar
 
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Define "too much time".

With only 400 rows, if it is slow, it is more likely the overhead of creating a connection rather than the data transfer time.

Make sure you enable connection pooling. After that, check if your JDBC drivers are up to date, and the servers/network configuration.
[ January 30, 2007: Message edited by: Chu Tan ]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shankar,
In addition to what Chu Tan sugested, access time to the database may also increase if you create too many connections and then dont close the connections, please make sure that you close all you connections, then with the correct drivers your access to the database should be quick.

Allen.
 
Allen Mathew Williams
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shankar,
In addition to what Chu Tan sugested, access time to the database may also increase if you create too many connections and then dont close the connections, please make sure that you close all you connections, then with the correct drivers your access to the database should be quick.

Allen.
 
amrita sankar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

Thank you for your suggestions.
I havent closed the connections that i have opened before and that might be the problem

Sankar
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic