Hi Krishnan,

        What you may consider doing is using the calender class and using the
SimpleDateFormat() with it as an easy method to calculate the start and end
time that the user has spent being logged in. When the user logs in you
would start that time and when the user logs off you would store (and maybe
do a calculationg to determine time spent logged in). Of course this only
works if the user logs off. Then when the user logs off you would update
your database (as you stated in your post).

calendar = Calendar.getInstance();
formatter = new SimpleDateFormat("DDDHHmmssSSS"); // Many formats available.

Sincerely,

Tom Kochanowicz


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Krishnan Srinivasan
Sent: Sunday, April 16, 2000 4:01 PM
To: [EMAIL PROTECTED]
Subject: Timing in Servlets


Hi,
   How do I keep track of the user timing from the logon to the logoff.Do I
start a timer when the session starts for the user and insert the timer when
he logs off and update the database(Oracle)?.
I would like to store this infrmation in a log file for the administrator to
see at the end of the day.

This is what I am storing eg.

UserName, IpAddress,RemostHost,TimeSpent(min),No.Times R/W to the DB
----------------------------------------------------------------
ABC      123.453.34.345    usa.gov.org   43        5

DEF       132.345.24.234   microsoft.com 32        3

The Last Column of the READ/WRITE. I thought of keeping a counter everytime
a button which calls a servelt is going to be clicked and always add that to
the session table .
I guess the session is really useful here
Let me know.

Thanks
Krishnan
Ps* Has anyone used the verisign for user authentication in Java
Webserver2.0? I am trying to ..


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to