• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

How to show the progress of the JDBC connection in JProgressbar?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to use JProgressBar to show the progress of
Java MySql connection. Is there any MySQL query which can use as
JProgressBar ?
 
Master Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean a specific query?
No.
You can show the progress of iterating over the response, but that may be a fraction of the time, depending on the query itself.
 
Saloon Keeper
Posts: 23263
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Expanding on Dave's answer:

When you make a JDBC query call, the call sends a request to the database server to do work. Often the server does not return a response until the work is totally complete. Or at best, until enough work has been done to determine the results. And until the server response comes back, the JDBC query call cannot return control to the application logic. It's like doing a progress bar on web pages - the only 2 progress values are 0% and 100%.

You can obviously get a count of records to be returned and manually count how many next() operations you have performed, but it's not going to be at all unusual for the server to take 5 minutes to return 3 records.
 
Beata Szabo-Takacs
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your response!
 
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic