• 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

CallableStatement executeQuery Hangs

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String sqlMain = "{CALL NCAPKG_PEAR_COMMON.NCASP_RECON_CREATE_PEAR(?, ?)}";
Connection conn = null;
conn = ResourceManager.getConnection(context);
CallableStatement cstmt = conn.prepareCall(sqlMain);
cstmt.registerOutParameter(1, Types.INTEGER);
cstmt.registerOutParameter(2, Types.VARCHAR);
Console.println("--> How nice? Let me execute the Query ..." );
cstmt.executeQuery();
Console.println("<-- done.");

Above is the code snippet.
The Moment it comes to executeQuery statements it hangs.

Can anybody tell me please what is wrong here?
If somebody faced similar kind of issue,please let me know.

Thank you
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Does the query finish if you run it directly in the DB, i.e. not using JDBC?
 
RajeshG Kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have not tested without jdbc, but same program executes when I point it to other DB server.


 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rajesh,
Welcome to JavaRanch!

Since it works on another database server, that implies the problem is at the database end. Some things to try:
- running the query in the stored proc directly against the database [this is what Ulf suggested]
- checking if there are any locks held on the tables accessed by the stored proc
- recompiling the stored procedure on the troublesome server
 
RajeshG Kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.

I will try this and update.
 
reply
    Bookmark Topic Watch Topic
  • New Topic