... we need more detail - are you running an applet, or a serverside sub-program? Are you hard-coding the database location and login into the java code itself, or using a separate set of code? Are you trying to get the time the timer is running, or the time the timer starts and the time the timer ends? (if the latter, use System.getCurrentTimeMillis() in the button actions!)
Answer these and give us some more info, and we should be able to help you
__________________
If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!