• 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
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

jdbc cancel query  RSS feed

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello :
is there a way to cancel a SQL query that takes long time to get the results
set in JDBC. Basically once a query is submitted
a prorgess bar or progress moniter should
display,which gives the user a chance to cancel.
Once cancelled the program control comes back
Any ideas, suggestion
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Selvan tiru,
If you had taken a look to the Statement Interface methods, you would have found that the method cancel(), answers exactly your question. This method assumes that both the driver and the database server support this operation.
Now if you are using a stored procedure to execute your query, you can still use the cancel() method since the CallableStatement and the PreparedStatement are both derived from the Statement Interface.
[This message has been edited by Omar IRAQI (edited July 12, 2001).]
The human mind is a dangerous plaything. This tiny ad is pretty safe:
global solutions you can do at home or in your backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!