I am using JDBC to link my program to MySQL.

I noticed that establishing a connection to MySQL can take about 6-10 seconds.
I want to use a JProgressBar to show the progress of the connection so that the user needen't think that my program crashed.

I tried inserting a simple print statement before and after the code. The print statement after the create connection printed only after 6-10 seconds.

I want to get progress between the connection.

Please I am not asking for you to do the full coding etc. Kindly tell me how I could acheive it?