Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-08-2010, 01:46 PM   PM User | #1
decade10
New to the CF scene

 
Join Date: Sep 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
decade10 is an unknown quantity at this point
counting down in java

hi,

whilst i was trying to do this program in javascript, i have been told that javascript isn't the right language to use (it needs to interact with a database, which javascript supposedly doesn't do).


it would be for a library reservation system. this would be put on the computers with sessions from 15 minutes to 2 hours (in 15 minute chunks i.e, 15, 30, 45, 1 hour).

this program would countdown the remaining time on their session, with pop-up messages appearing every so often.

at the end of the session, the program will have to automatically log the user off.

any tips would be appreciated, thanks
decade10 is offline   Reply With Quote
Old 09-08-2010, 02:27 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Yes, this cannot be done with javascript by itself if you want to interact with a database.
Look at the Timer: http://download.oracle.com/javase/1....til/Timer.html which includes a schedule and allows you to execute a TimerTask every x milliseconds.
The TimerTask itself will need to be extended and overridden, and runs as a thread, so the run() must be overridden to take care of the task you want (such as a JDialog).
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:30 AM.


Advertisement
Log in to turn off these ads.