• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

SQL's Execution from Springs taking long time.

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Not sure if this is the right group to post my question.
Am working with Springs Framework 2.0, DB2.
I have a SQL which when Executed from the DB2 query editor returns me the data set in about 3 mins
but, when I execute the same from my program takes atleast 40 mins to return the same data set.
All the network connections and configurations are good.
FYI, I'm using the JDBC template to query the Database.
Any suggestions or guidance is appreciated.

Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello SriHarsha,

Welcome to JavaRanch!

Can you execute a simple query. Does it take equal time in both ways? Are database and server on the same machine?
I am just guessing. Tell us more detail. Show us the code?
SriHarsha Reddy
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Vishal for the quick response.
Yes I did try execute many queries and almost all the queries that am running DB are perfect and return my record set in at most 5 mins.
But, when I try execute the same thing from my applicaiton I happen to see this reported issue.

As you have asked me here's the information,

Database and Application are both different servers. Move'ver am still in Dev phase and running the server at my local host the DB is still a different server though.

code snap shot...
---start of code...
public List Adjuster_Fee_Exception_Report_Closed_Property_For_Non_Cat(DynamicReportTO param) throws Exception {
List list = null;
String lob = null;

String sql = getQualifiedSQL((SQLMap)xmlSqlMap.get("claims-adjaccounts"), "Adjuster_Fee_Exception_Report_Closed_Property_For_Cat_NonCat");
log.info("The query to list report " + reportName(param.getReportType(), param.getReportBusinessID()) +" ===> " + sql);

if (param.getAccountType().equalsIgnoreCase("PLA")){
lob = "'DP'," + "'HO'";
}else {
lob = "'DW','HW','WI'";
sql = sql.replaceAll("#rLOB#", lob);

Object parameters[] = {new Date(param.getIncurredDate().getTime()), new Date(param.getEndDate().getTime()), new Date(param.getIncurredDate().getTime()), new Date(param.getEndDate().getTime()), new Date(param.getStartDate().getTime()), new Date(param.getEndDate().getTime()), new Integer(0), new Integer(param.getCatType()), new Date(param.getEndDate().getTime()), new Date(param.getEndDate().getTime())};

int parameterTypes[] = {Types.DATE, Types.DATE, Types.DATE, Types.DATE, Types.DATE, Types.DATE, Types.INTEGER, Types.INTEGER, Types.DATE, Types.DATE};
XYZJdbcTemplate xyzJdbcTemplate = (xyzJdbcTemplate) getJdbcTemplate();
list = XYZJdbcTemplate.query(sql, parameters, parameterTypes,new RowMapperResultReader(new CR0010Reader()));

return list;

--End of Code.

FYI, XYZJDBCTemplate is the customized version of JDBCTemplate it accepts the parameter via xyzJDBCTemplate and pass them on to the Springs JDBCTemplate

It means our mission is in jeapordy! Quick, read this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!