How can I design an algorithm for determining the progress of a particular process (see below) in Java?

I’m designing a Java application that has a login dialog, but if it’s the first time the user has ever used the application, I want to provide a “Create account” dialog. However, I need to connect to the MySQL database in order to figure this out—what the app actually does is see if the database exists, and if it does, it’ll then check if the table that contains the login information exists and some other stuff. However, on some user’s computers, this may be a bit slow, and I don’t want the user to think that it’s broken or whatever. I know I could use an indeterminate progress bar in a dialog, but after a while, some users might think that the program is not responding. So how can I determine the progress of such a process? Thanks!