Pl/sql web application login and logout problem

Hi, every expert.
I am making a web application with pl/sql, and I focus on the login and logout recently.
I make use of owa_cookie to login and logout, it works wonder in login process as the cookie values are sent to the page successfully, and cookie info was killed successfully when logging out, but the problem is when i click the back button on the browser it can still go back to the previous page, only if i refresh it again it can work propely

As far as I know, there is only Java API for managing the application. You might need to look into making some java web services to handle this.

Similar Messages

  • Sql query to find activities between Login and Logout time

    Hi ,
    I have 2 tables as shown below
    User Table
    ActivityTable
    i have  a requirement in which i need to find all the activities done for a particular user inbetween login and logout time  can anybody help me how to write sql query for this .

    Is this what you looking for?
    DECLARE @User TABLE
    userid INT,
    date DATETIME,
    type VARCHAR(50),
    sessionid SMALLINT
    DECLARE @ActivityTable TABLE
    activityid SMALLINT,
    userid SMALLINT,
    activity VARCHAR(50),
    activitystarttime DATETIME,
    activityendtime DATETIME
    INSERT INTO @User
    (userid,
    [date],
    [type],
    sessionid)
    VALUES (1,
    '2002-08-25 16:51:25.107',
    'Logon',
    111),
    (1,
    '2002-08-25 17:52:25.107',
    'LOGOFF',
    111),
    (2,
    '2007-03-08 19:25:21.170',
    'Logon',
    222),
    (2,
    '2007-03-08 21:25:21.170',
    'LOGOFF',
    222),
    (3,
    '2007-03-08 19:25:21.170',
    'Logon',
    234);
    INSERT INTO @ActivityTable
    (activityid,
    userid,
    activity,
    activitystarttime,
    activityendtime)
    VALUES (234,
    1,
    'development',
    '2002-08-25 16:53:23.101',
    '2002-08-25 16:59:23.170'),
    (789,
    2,
    'Testing',
    '2007-03-08 19:53:23.180',
    '2007-03-08 20:53:23.180'),
    (789,
    2,
    'Lunch',
    '2007-03-08 19:53:23.180',
    '2007-03-08 20:53:23.180'),
    (456,
    3,
    'Testing',
    '2007-03-08 19:53:23.180',
    '2007-03-08 20:53:23.180'),
    (781,
    1,
    'Lunch',
    '2002-08-25 17:00:23.101',
    '2002-08-25 17:30:00.170'),
    (781,
    1,
    'Lunch',
    '2002-08-25 21:00:23.101',
    '2002-08-25 22:30:00.170');
    WITH logon
    AS (SELECT date,
    userid
    FROM @User
    WHERE type = 'Logon'),
    logoff
    AS (SELECT date,
    userid
    FROM @User
    WHERE type = 'LOGOFF')
    SELECT at.*
    FROM @ActivityTable AT
    INNER JOIN logon Lo
    ON at.userid = lo.userid
    INNER JOIN logoff LF
    ON at.userid = lf.userid
    WHERE At.activityendtime < LF.date
    AND AT.activitystarttime > LO.date
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • How to make a login and logout in jsf  2.0 ?

    Hello all, i am developing an web application have login and logout component. I want to check whenever end user try to open admin/index.xhtml, it will be redirected to login.xhtml. And when end user click on log out button, i will be destroy session and redirect end user to login.xhtml. But i am not sure about session in JSF 2.0. I am using netbean 6.9.1 to develop. First time, when i run my web application, i can get session back. But another time, i can't get session in my bean. Do i can use filter with JSF 2.0 to make a validate login user ? And any suggestion for my issue ? Thanks in advance!
    Here is my filter with doFilter method:
    RequestWrapper wrappedRequest = new RequestWrapper((HttpServletRequest) request);
    ResponseWrapper wrappedResponse = new ResponseWrapper((HttpServletResponse) response);
    if (wrappedRequest.getSession().getAttribute("isValidUser") != null) {
    chain.doFilter(request, response);
    } else {
    goPage(wrappedRequest, wrappedResponse, "/faces/enduser/index.xhtml");
    And here is my bean with login and log out method:
    public String validUser() {
    try {
    if (iAccBO != null) {
    Utilities utilities = new Utilities();
    Account account = new Account();
    account.setAccName(getAccName());
    account.setPassword(utilities.encode(getPassword()));
    if (iAccBO.validUser(account)) {
    setAccName("");
    setPassword("");
    return "/admin/index";
    } else {
    FacesContext fc = FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "invalid username or password", ""));
    return "login";
    } catch (Exception ex) {
    ex.printStackTrace();
    Logger.getLogger(AccountBean.class.getName()).log(Level.SEVERE, null, ex);
    return null;
    public String Logout() {
    try {
    servletRequest.getSession().invalidate();
    return "../login";
    } catch (Exception e) {
    e.printStackTrace();
    return "";
    Best Regards,
    Coy.

    I looked up it but it seem not work with me. Almost example which i found is run on Glass Fish. But I am running on TomCat server of Netbeans 6.9.1. Can someone give me another suggestion ?
    Thanks in advance!
    Best Regards,
    Coy.

  • Safari 7 Preferences: I can't delete a web site login and password

    Hello:
    I can't delete a safari web site login and password
    After tapping delete all there is 1 item still in the box.
    ¿How can I delete it?
    Thak's in advance,
    Luis

    I had the same problem, and the solution was to delete the entries using the Keychain Access tool, found in Applications → Utilities. You can search for the entry there, remove it, and then it will be deleted from Safari as well.
    (I had to do this when I changed my email address on Amazon, and all the auto-login pages had the old email addresses and wouldn't update. I tried to delete them from Safari's passwords dialog and ran into the problem you described).
    Note that this question provides the same answer in more detail.

  • Correlate login and logout times in a table

    I have a table LOGINDATA with three columns: USERID, TYPE, and TIMESTAMP.
    USERID stores a unique integer that represents someone who uses the system.
    TYPE is either 1 or 2. 1 represents a login. 2 represents a logout.
    TIMESTAMP is a value that comes from System.currentTimeMillis. It represents the current time in milliseconds since January 1, 1970 (I believe that's the right date).
    I'm trying to create a query to link each login time with its corresponding logout time, so that my resultset has three columns:
    USERID, LOGINTIME, LOGOUTTIME.
    I assume this would involve joining the table to itself, but creating a query to find the closest login and logout times is tricky.
    What I have now is:
    select li.userid, li.logintime, lo.logouttime from
    (select userid, timestamp logintime from logindata where type = 1) li,
    (select userid, timestamp logouttime from logindata where type = 2) lo
    where li.userid=lo.userid
    and li.userid=999999 is the userid of one user.
    This will actually end up being more complicated with missing logout times, but this is a start.

    The data design makes this a very very very messy (and probably slow) query. Fundamentally, I consider designs like this to be broken because they're so hard to get relevant information out of the raw data; in some cases impossible (see comments below).
    The following query works on Oracle database (where TIMESTAMP is a reserved word, so I used EVENTTIME instead) - I tested it with a few rows of data:
    select li.userid, li.logintime, min(possible_logout) logouttime
    from (select userid || to_char(eventtime, 'yyyymmddhh24miss') session_id, userid, eventtime logintime
          from logindata where type = 1) li,
       (select li.userid || to_char(logintime, 'yyyymmddhh24miss') session_id, li.userid, logintime, logouttime possible_logout
        from (select userid, eventtime logintime from logindata where type = 1) li,
             (select userid, eventtime logouttime from logindata where type = 2) lo
        where logintime < logouttime
          and li.userid = lo.userid(+) ) pl
    where li.session_id = pl.session_id (+)
    group by li.userid, li.logintime
    order by li.logintime;Note that this will return the wrong result if for a particular user_id, you have overlapping logins, like:
    time a - login session 1
    time b - login session 2
    time c - logout session 1 or 2
    time d - logout session 2 or session 1
    there is simply no way to tell which logout goes with which login and the query will report that both sessions ended at time c, which is absolutely unacceptable if this is to be a security audit trail... The only way to deal with this is to guarantee at the application layer that no user can be logged in twice.
    Note also that it breaks by returning extra rows if a user somehow manages to log in twice or more at the same moment, whatever the granularity of your TIMESTAMP is... This is because of the join on the generated SESSION_ID; if you get 2 or more of them the same, you get a cartesian product (2 IDs, 4 rows; 5 IDs, 25 rows, etc...)
    It would obviously be a lot cleaner if you stored some sort of unique session_id in your table. Note that the session_ids used for session tracking in J2EE web servers get recycled over time and are therefore unsuitable (by themselves) as unique session ids. And if you store a session id, then you can fix your broken data model and avoid all this mess in the first place by making your table have the columns:
    USER_ID, SESSION_ID, LOGIN_TIME, LOGOUT_TIME
    Insert on login, update on logout...

  • Report for login and logout time

    Dear All,
    Please can some one help me urgently.
    I have to find out users login and logout time over the last six months. I need to find out how many hours per user are being used.  What report do I need to run to find out ?

    Hi,
    Check the system log saved in your system.Normally the basis admin woulfd know better about this .Only they have the access and maintance for it.
    Anyways u can try out some other ways also
    Profile parameters rslg/local/file
    /usr/sap/<SID>/D20/log/SLOG<SAP-instance_number> Specifies the location of the local log on the application server.
    Alternatively try to  table - SYST
    Note:  there are many transaction codes that can be accessed only by super users .do tell me if u have one so that i can give you?

  • Web Application Proxy and Safari

    Morning, all.
    I've installed and configured the new Windows Server 2012 R2 AD FS and Web Application Proxy, and I've run into some strange problems. I had some initial problems getting it to work, the documentation is a bit thin, but I now have Sharepoint and Webmail
    published to the Internet.
    I'm using x.509 Certificate Authentication for Extranet.
    In IE on a Windows 8.1 Surface Pro everything works. I can log in using ether a softcert or a SmartCard.
    On my OS X Mac I can log in using Chrome, but Safari won't work.
    Same thing on my iPad running iOS 7.0.4, Safari won't work. Interestingly enough, on my 7.0.4 iPhone it DOES work. Even more interestingly, I CAN Workplace Join the iPad using the URL https://<adfs fqdn>/enrollmentserver/otaprofile but
    I can't authenticate using the URL https://<adfs fqdn>/adfs/ls/IdpInitiatedSignon.aspx.
    I get to select my certificate, but after that I'm getting this error message: "Safari cannot open the page because too many redirects occurred." In the Event log on the AD FS server I'm getting this:
    Encountered error during federation passive request. 
    Additional Data 
    Protocol Name: 
    Saml 
    Relying Party: 
    http://<adfs fqdn>/adfs/services/trust 
    Exception details: 
    Microsoft.IdentityServer.Web.InvalidRequestException: MSIS7042: The same client browser session has made '6' requests in the last '0' seconds. Contact your administrator for details.
       at Microsoft.IdentityServer.Web.Protocols.PassiveProtocolHandler.UpdateLoopDetectionCookie(WrappedHttpListenerContext context)
       at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.SendSignInResponse(SamlContext context, MSISSignInResponse response)
       at Microsoft.IdentityServer.Web.PassiveProtocolListener.ProcessProtocolRequest(ProtocolContext protocolContext, PassiveProtocolHandler protocolHandler)
       at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)
    Since it does work on an iPhone running the same browser, and Workplace Join does work on the iPad even if nothing else does I'm thinking there's some UserAgent voodoo going on in parts of the Web Application Proxy. It's no big deal that Safari in OS X doesn't
    work, we can always run Chrome, but the iPad is a major problem and a total deal breaker if I can't fix it.
    I would appreciate some good advice.

    Hi,
    As both IE and Chrome work, I think it’s more a client side issue.
    Maybe you need to clear you browser cache and cookies.
    This also worth a try:
    http://stackoverflow.com/questions/2640030/adfs-v2-0-error-msis7042-the-same-client-browser-session-has-made-6-request
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Hope this helps.

  • PL/SQL Web Application

    Hi buddies,
    I am working with a PL/SQL Web Application.
    htp.p('<form>');
    htp.p('<select name="seasons">');
    htp.p('<option value="winter">Winter');
    htp.p('<option value="spring">Spring');
    htp.p('<option value="summer">Summer');
    htp.p('<option value="fall">Fall');
    htp.p('</select>');I have 2 parts in the page, one is header and the other is body.
    I tried to add this to the header and access the value in a sql statement in the body like this
    displaying a table in html
    select .... from MyTable
    where MyTable.seas = seasons;I tried placing the form in the body, still I couldn't solve the issue.
    How can I retrieve the value for the selected value?
    Please advice.
    Thanks.
    Alagu

    Application Developer's Guide - Fundamentals Contents / Search / Index / PDF
    Chapter 18
    http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96590.pdf
    Joel Pérez

  • Tracking User login and logout times

    I need to track User Login and Logout times. Does anyone know of a easy way or program to do this?
    thanks
    b

    /Applications/Utilities->Terminal->type in this command, and hit the return key:
    last
    For more information, see http://www.osxfaq.com/tips/unix-tricks/ Week 17.

  • Session Login and Logout in jsp page

    hi
    i am developing jsp page
    i completed except logout.jsp page
    my login page is in Jsp format and then business Logic in servlet and then get method & set method in bean.java
    i have login and then it sucess page there i have singout button
    if i sign out it should go to login page
    how to do
    how to make session invalidate
    how to get session id
    i have one more doubt i should check session invalidate each jsp page
    regarding session login and logout in jsp
    if anybody knows please give me a piece of code regarding login and logout
    Regards
    Akshatha

    This is part of your filter class now you need login.jsp page
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="Stylesheet" type="text/css" href="/PAS/css/site.css"/>
        <title>Automation System | Login Page</title>
    </head>
    <body>
    <div align="center">
        <h1>Photint Automation System</h1>
    </div>
    <br/><br/><br/>
    <center>
        <table border="1" cellpadding="0" cellspacing="0" width="40%" bgcolor="FFFFFFFF">
            <thead>
                <tr>
                    <th align="left" height="30"> <h3>    Login</h3></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <div align="center">
                            <form name="LOGIN" action="/PAS/LoginServlet" method="POST">
                                <table border="0">
                                    <tbody>
                                        <tr>
                                            <td height="15"></td>
                                            <td height="15"></td>
                                            <td height="15"></td>
                                            <td height="15"></td>
                                        </tr>
                                        <tr>
                                            <td height="30"></td>
                                            <td align="right" height="30">User Name : </td>
                                            <td align="left"  height="30"><input type="text" name="USERNAME" value="" size="35"  /></td>
                                            <td height="30"></td>
                                        </tr>
                                        <tr>
                                            <td height="30"></td>
                                            <td align="right" height="30">Password : </td>
                                            <td align="left"  height="30"><input type="password" name="PASSWORD" value="" size="35"  /></td>
                                            <td height="30"></td>
                                        </tr>
                                        <tr>
                                            <td height="50"></td>
                                            <td height="50"></td>
                                            <td align="center" height="50"><input type="submit" value="Login" name="Login" />  <input type="reset" value="Reset" name="Reset" /></td>
                                            <td height="50"></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </center>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    <br/><br/><br/>
    <center>Copyright &copy; 2009 Photint FZ LLC</center>
    <center>Powered by Ali Jamali</center>
    <center>Version : 1.0</center>
    </body>
    </html>And you need loginServlet.java
    package com.ali.util.filter;
    import com.ali.entity.user.UserEntity;
    import com.ali.util.HibernateUtil;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class LoginServlet extends HttpServlet {
        private static final long serialVersionUID = 1L;
        protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            String username = request.getParameter("USERNAME");
            String password = request.getParameter("PASSWORD");
            if (username == null || username.length() == 0) {
                System.err.println(" Username textfeild is empty ..... !");
                RequestDispatcher dispatcher = request.getRequestDispatcher("Pages/user/LogIn.jsp");
                dispatcher.forward(request, response);
                return;
            if (UserRegistry.isUserLoggedIn(username)) {
                System.out.printf("User [%s] is already logged in. \n", username);
                RequestDispatcher dispatcher = request.getRequestDispatcher("Pages/user/LogIn.jsp");
                dispatcher.forward(request, response);
                return;
            UserEntity user = null;
            try {
                user = (UserEntity) HibernateUtil.load(UserEntity.class, username);
                if (user == null || !user.getPassword().equals(password)) {
                    RequestDispatcher dispatcher = request.getRequestDispatcher("Pages/user/LogIn.jsp");
                    dispatcher.forward(request, response);
                    System.err.println(" Password or username is not valid ..... !");
                    return;
            } catch (Exception e) {
                e.printStackTrace();
                RequestDispatcher dispatcher = request.getRequestDispatcher("Pages/user/LogIn.jsp");
                dispatcher.forward(request, response);
                return;
            HttpSession session = request.getSession();
            System.err.println(request.getRemoteAddr());
            session.setAttribute("username", user.getFirstName());
            session.setAttribute("userType", user.isAdmin());
            UserRegistry.logInUser(username);
            response.sendRedirect("/PAS/index.jsp");
    }finally is you need to just one user can be online at time or need to know how many user & who is online you should at this class also
    package com.ali.util.filter;
    import java.util.ArrayList;
    import java.util.List;
    public class UserRegistry {
        private static final List loggedInUsers = new ArrayList();
        public static void logInUser(String username) {
            loggedInUsers.add(username);
        public static void logoutUser(String username) {
            if (isUserLoggedIn(username)) {
                loggedInUsers.remove(username);
        public static boolean isUserLoggedIn(String username) {
            return loggedInUsers.contains(username);
    }If you have any more Q. or any comment , Most welcome
    Thanks
    Ali Jamali

  • I NEED TO GET LOGIN AND LOGOUT TIMING DETAILS FROM CLIENT SYSTEMS

    HI,
    CAN ANYONE PLEASE HELP ME ON HOW TO GET LOGIN AND LOGOUT , CLIENT EVENT DETAILS FROM CLIENT SYSTEMS ON SERVER 2008 R2.
    THANKS,
    KUMAR.

    You may need to enable active directory Logon/Logoff Audit event.
    The Audit logon events policy records all attempts to log on to the local computer, whether by using a domain account or a local account.
    On Domain Controller, this policy records attempts to access the DC only.
    By using these events we can track user's logon duration by mapping logon and logoff events with user's Logon ID which is unique between user's logon and logoff.
    Please refer to this blog to understand the complete process to audit the successful or failed logon and logoff attempts in the network using the audit policies :
    http://www.lepide.com/blog/audit-successful-logon-logoff-and-failed-logons-in-activedirectory/
    Lepide - Simplifying IT Management

  • View logs in windows server (User login and logout )

    Hi Guys,
    I want to see the user login and logout times to the systems. I want know on which systems (Hostname) they logged into that account. 
    Could you please help me. Thanks in advance

    Hi
     You can check the log's on event viewer console,here is good article for your needs,please check;
    https://support.microsoft.com/en-us/kb/556015?wa=wsignin1.0

  • Calculating Login and Logout Times - need help

    Hi everyone. I have the first part of this code and can't seem to figure out the time calculation part. What it is - create a code that asks for a user name or social security number, then the person enters up to 6 login and logout times for the day. They also have the option to enter personal time or sick time (neither of which can be over 8 hours). I have all of that complete, but I can't figure out how to get the in and out times and the leave times to calculate. I have 3 pieces of code - here they are:
    Hours:
    import java.util.*;
    public class Hours
         //define states of Hours
         int regularhoursInt = 0;
         int regularminutesInt = 0;
         int overtimehoursInt = 0;
         int overtimeminutesInt = 0;          
         //set hours worked
         public void setHours(int timein, int timeout)
              int temphoursin = timein/100;
              int tempminutesin = timein - timein/100;
              int temphoursout = timeout/100;
              int tempminutesout = timeout - timeout/100;
              GregorianCalendar time1 = new GregorianCalendar(2003, 8, 1, temphoursin, tempminutesin, 0);
              GregorianCalendar time2 = new GregorianCalendar(2003, 8, 1, temphoursout, tempminutesout, 0);
              //store to date
              Date d1 = time1.getTime();
              Date d2 = time2.getTime();
              //store time to long
              long t1 = d1.getTime();
              long t2 = d2.getTime();
              //subtract and convert to seconds
              long time = (t2 - t1)/1000;
              long tempregularLong = 0;
              long tempovertimeLong = 0;
              //see if regular hours are over 8 hours (28800 seconds)
              tempregularLong = time;
              if (tempregularLong > 28800)
                   tempovertimeLong = tempregularLong - 28800;
                   tempregularLong = tempregularLong - tempovertimeLong;
              //convert to hours and minutes
              regularhoursInt = regularhoursInt + (Integer.parseInt(Long.toString(tempregularLong)) / 3600);
              regularminutesInt = regularminutesInt + (Integer.parseInt(Long.toString(tempregularLong)) / (3600 * regularhoursInt));
              overtimehoursInt = overtimehoursInt + (Integer.parseInt(Long.toString(tempovertimeLong)) / 3600);
              overtimeminutesInt = overtimeminutesInt + (Integer.parseInt(Long.toString(tempovertimeLong)) / (3600 * regularhoursInt));     }
         // get regular hours worked
         public int getRegularHours()
              return regularhoursInt;
         // get regular minutes worked
         public int getRegularMinutes()
              return regularminutesInt;
         //get overtime hours worked
         public int getOvertimeHours()
              return overtimehoursInt;
         // get overtime minutes worked
         public int getOvertimeMinutes()
              return overtimeminutesInt;
    Employee:
    public class Employee
         //define states of employee
         String nameString = "";
         String ssnString = "";
         double payrateDouble = 0;
         double hoursworkedDouble = 0;
         double overtimehoursDouble = 0;
         double sickleaveDouble = 0;
         double personalleaveDouble = 0;
         double totalpayDouble = 0;
         //set and get employee name
         public void setName(String name)
              nameString = name;
         public String getName()
              return nameString;
         //set and get employee ssn
         public void setSsn(String ssn)
              ssnString = ssn;
         public String getSsn()
              return ssnString;
         //set and get employee payrate
         public void setPayRate(double payrate)
              payrateDouble = payrate;
         public double getPayRate()
              return payrateDouble;
         //set and get employee hours worked
         public void setHoursWorked(double hoursworked)
              hoursworkedDouble = hoursworked;
         public double getHoursWorked()
              return hoursworkedDouble;
         //set and get employee overtimehours
         public void setOverTime(double overtime)
              overtimehoursDouble = overtime;
         public double getOverTime()
              return overtimehoursDouble;
         //set and get employee sick leave hours
         public void setSickLeave(double sickleave)
              sickleaveDouble = sickleave;
         public double getSickLeave()
              return sickleaveDouble;
         //set and get employee sick leave hours
         public void setPersonalLeave(double personalleave)
              personalleaveDouble = personalleave;
         public double getPersonalLeave()
              return personalleaveDouble;
         //get employees total pay
         public double getTotalPay()
              //calculate regular pay
              totalpayDouble = payrateDouble * hoursworkedDouble;
              //add in any over time pay
              totalpayDouble = totalpayDouble + payrateDouble * 1.5 * overtimehoursDouble;
              //add in any sick time pay
              totalpayDouble = totalpayDouble + payrateDouble * sickleaveDouble;
              //add in any personal leave time pay
              totalpayDouble = totalpayDouble + payrateDouble * personalleaveDouble;
              return totalpayDouble;
    Entry Screen:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    import javax.swing.*;
    import java.util.*;
    import java.text.*;
    //create entryscreen class as a java applet
    public class EntryScreen extends Applet implements ActionListener
         //declare all variables, labels, textfields, and buttons
    //store pay rate to variable payrateDouble
         double payrateDouble = 10.00;
         //store ssn and names to ssnString
         String[][] ssnString ={{"123121234", "234232345", "345343456", "456454567",
              "567565678", "678676789"},{"Jane Doe", "John Doe", "Sam Smith", "Tom Thumb", "Sara Jane", "Cindy Thompson"}};
         //set date format to MM/dd/yy and store in variable formatter
         SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
         //store current date to variable date
         Date date = new Date();
         //using variable formatter store current date to dateString
         String dateString = formatter.format(date);
         //declare all label, Textfields and buttons use in the applet
         JLabel titleLabel;
    JLabel dateLabel;
    JTextField dateTextField;
    JLabel ssnLabel;
    JTextField ssnTextField;
    JLabel timeLabel;
    JLabel inLabel;
    JLabel outLabel;
    JTextField in1TextField;
    JTextField in2TextField;
    JTextField in3TextField;
         JTextField in4TextField;
         JTextField in5TextField;
    JTextField in6TextField;
    JTextField out1TextField;
    JTextField out2TextField;
    JTextField out3TextField;
    JTextField out4TextField;
    JTextField out5TextField;
    JTextField out6TextField;
    JLabel sickLabel;
    JTextField sickTextField;
    JTextField personalTextField;
    JLabel personalLabel;
    JButton okButton;
    JButton clearButton;
    JLabel day1Label;
    JLabel day2Label;
    JLabel day3Label;
    JLabel day4Label;
    JLabel day5Label;
    JLabel day6Label;
         //initialize the applet screen
    public void init()
              //create a custom layout object based on the EntryScreenLayout class
              EntryScreenLayout customLayout = new EntryScreenLayout();
              //set the font for the screen
    setFont(new Font("Helvetica", Font.PLAIN, 12));
    setLayout(customLayout);
         //populate the applet with the labels, textfields, and buttons
              titleLabel = new JLabel("Employee Payroll System");
    add(titleLabel);
    dateLabel = new JLabel("Date (MM/DD/YY):");
    add(dateLabel);
    dateTextField = new JTextField("");
    add(dateTextField);
              //set text in field to current date
              dateTextField.setText(dateString);
    ssnLabel = new JLabel("SSN (Numbers Only):");
    add(ssnLabel);
    ssnTextField = new JTextField("");
    add(ssnTextField);
    timeLabel = new JLabel("Hours Worked (hhmm)");
    add(timeLabel);
    inLabel = new JLabel("In:");
    add(inLabel);
    outLabel = new JLabel("Out");
    add(outLabel);
    in1TextField = new JTextField("");
    add(in1TextField);
    in2TextField = new JTextField("");
    add(in2TextField);
    in3TextField = new JTextField("");
    add(in3TextField);
    in4TextField = new JTextField("");
    add(in4TextField);
    in5TextField = new JTextField("");
    add(in5TextField);
    in6TextField = new JTextField("");
    add(in6TextField);
    out1TextField = new JTextField("");
    add(out1TextField);
    out2TextField = new JTextField("");
    add(out2TextField);
    out3TextField = new JTextField("");
    add(out3TextField);
    out4TextField = new JTextField("");
    add(out4TextField);
    out5TextField = new JTextField("");
    add(out5TextField);
    out6TextField = new JTextField("");
    add(out6TextField);
    sickLabel = new JLabel("Sick Leave Used:");
    add(sickLabel);
    sickTextField = new JTextField("");
    add(sickTextField);
    personalTextField = new JTextField("");
    add(personalTextField);
    personalLabel = new JLabel("Personal Leave Used:");
    add(personalLabel);
         okButton = new JButton("Ok");
         add(okButton);
              okButton.addActionListener(this);
         clearButton = new JButton("Clear");
         add(clearButton);
              clearButton.addActionListener(this);
         day1Label = new JLabel("Day 1:");
         add(day1Label);
         day2Label = new JLabel("Day 2:");
         add(day2Label);
    day3Label = new JLabel("Day 3:");
    add(day3Label);
    day4Label = new JLabel("Day 4:");
    add(day4Label);
    day5Label = new JLabel("Day 5:");
    add(day5Label);
    day6Label = new JLabel("Day 6:");
              add(day6Label);
              //set the size of the applet window as listed in the EntryScreenLayout class
              setSize(getPreferredSize());
         public void actionPerformed(ActionEvent e)
              //get the source object
              Object source = e.getSource();
              //perform if OK button was presses      
              if(source == okButton)
                   int[][] inouttimes = new int[1][5];
                   boolean matchBoolean = false;
                   boolean timeError = false;
                   int locationInt = 0;
                   double[] leavehours = new double[1];
                   String messageString = "";
                   //get the text from the ssnTextField and store to inputString
                   String inputString = ssnTextField.getText();
                   //check to see if inputString matches ssnString array
                   for(int i = 0; i < 6; ++i)
                        //if a match assign variables
                        if (inputString.equals(ssnString[0]))
                             matchBoolean = true;
                             locationInt = i;
                             break;
                        //if not a match
                        else
                             matchBoolean = false;
                   }//end for i
                   //if a SSN match is true than display the name, SSN, total hours, overtime hours, and total pay for hours worked.
                   if (matchBoolean == true)
                        //get the check in/out times, if blank assign a zero
                        Employee temp = new Employee();
                        temp.setName(ssnString[1][locationInt]);
                        temp.setSsn(ssnString[0][locationInt]);
                        temp.setPayRate(payrateDouble);
                        temp.setSickLeave(Double.parseDouble(sickTextField.getText()));
                        temp.setPersonalLeave(Double.parseDouble(personalTextField.getText()));
                        /*inouttimes[0][0] = Integer.parseInt(in1TextField.getText());
                        inouttimes[1][0] = Integer.parseInt(out1TextField.getText();
                        inouttimes[0][1] = Integer.parseInt(in2TextField.getText();
                        inouttimes[1][1] = Integer.parseInt(out2TextField.getText();
                        inouttimes[0][2] = Integer.parseInt(in3TextField.getText();
                        inouttimes[1][2] = Integer.parseInt(out3TextField.getText();
                        inouttimes[0][3] = Integer.parseInt(in4TextField.getText();
                        inouttimes[1][3] = out4TextField.getText();
                        inouttimes[0][4] = in5TextField.getText();
                        inouttimes[1][4] = out5TextField.getText();
                        inouttimes[0][5] = in6TextField.getText();
                        inouttimes[1][5] = out6TextField.getText();
                        for (int x = 0; x < 2; ++x)
                             for (int y = 0; y < 2; ++y)
                                  String temp = String.valueOf(inouttimes[x][y]);
                                  if (temp.equals(""))
                                       inouttimes[x][y] = 0;
                                  if (inouttimes[x][y] < 0 && inouttimes[x][y] > 2400)
                                       timeError = true;          
                                       break;
                             if (timeError = true)
                                  break;
                        messageString = temp.getName() + "\n" + temp.getSsn() + "\n" + temp.getTotalPay();
                   JOptionPane.showMessageDialog(null, messageString);
                   }//if (matchBoolean == true)
                   //if SSN match is false then display error message
                   else
                        JOptionPane.showMessageDialog(null, "There is no listing under that Social Security Number.\n" +
                             "Please verify and re-enter.");                    
              }//end if(source == okButton)
              //perform if the Clear button was pressed
              if(source == clearButton)
                   //clear all the textfields
                   dateTextField.setText("");
                   ssnTextField.setText("");
                   in1TextField.setText("");
                   out1TextField.setText("");
                   in2TextField.setText("");
                   out2TextField.setText("");
                   in3TextField.setText("");
                   out3TextField.setText("");
                   in4TextField.setText("");
                   out4TextField.setText("");
                   in5TextField.setText("");
                   out5TextField.setText("");
                   in6TextField.setText("");
                   out6TextField.setText("");
                   sickTextField.setText("");
                   personalTextField.setText("");
                   //set text in field to current date
                   dateTextField.setText(dateString);
         public static void main(String args[])
              //create new entryscreen object called applet
              EntryScreen applet = new EntryScreen();
         //create new frame for applet called window
              Frame window = new Frame("EntryScreen");
         window.addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                   //close the applet           
                        System.exit(0);
              //initiate the applet
              applet.init();
    window.add("Center", applet);
    window.pack();
    window.setVisible(true);
    //create entryscreenlayout custom class to position controls on applet screen
    class EntryScreenLayout implements LayoutManager {
    public EntryScreenLayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 360 + insets.left + insets.right;
    dim.height = 487 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+8,192,24);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+48,152,24);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+48,152,24);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+80,152,24);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+80,152,24);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+112,152,24);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+144,72,24);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+144,72,24);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+176,72,24);}
    c = parent.getComponent(9);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+208,72,24);}
    c = parent.getComponent(10);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+240,72,24);}
    c = parent.getComponent(11);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+272,72,24);}
    c = parent.getComponent(12);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+304,72,24);}
    c = parent.getComponent(13);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+336,72,24);}
    c = parent.getComponent(14);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+176,72,24);}
    c = parent.getComponent(15);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+208,72,24);}
    c = parent.getComponent(16);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+240,72,24);}
    c = parent.getComponent(17);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+272,72,24);}
    c = parent.getComponent(18);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+304,72,24);}
    c = parent.getComponent(19);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+336,72,24);}
    c = parent.getComponent(20);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+368,152,24);}
    c = parent.getComponent(21);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+368,72,24);}
    c = parent.getComponent(22);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+400,72,24);}
    c = parent.getComponent(23);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+400,152,24);}
    c = parent.getComponent(24);
    if (c.isVisible()) {c.setBounds(insets.left+104,insets.top+440,72,24);}
    c = parent.getComponent(25);
    if (c.isVisible()) {c.setBounds(insets.left+184,insets.top+440,72,24);}
    c = parent.getComponent(26);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+176,72,24);}
    c = parent.getComponent(27);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+208,72,24);}
    c = parent.getComponent(28);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+240,72,24);}
    c = parent.getComponent(29);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+272,72,24);}
    c = parent.getComponent(30);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+304,72,24);}
    c = parent.getComponent(31);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+336,72,24);}
    I know it is a lot of code, but I am just starting and couldn't think of an easier way to do this.
    Thank you for any help - it is greatly appreciated. You can email me with any code help - [email protected].
    Steph

    My 2 cents, I dunno what it'll be worth.
    I think you should never convert anything until the final moment that you are at actually getting the int or float number of hours.
    Why are you doing all this Gregorian and conversion gymnastics throughout your calculations?
    To get the current time in milliseconds, use either
    java.util.Date d = new java.util.Date();
    or
    long d = System.currentTimeMillis();
    Use this long number for all your calculations, and only at the end convert it. To convert, you can use java.text.SimpleDateFormat, which I find very straightforward to use. I honestly think you should never convert your dates before doing any calculations, only after doing them, otherwise you'll loose precision and make errors for sure.

  • Tutorial required to explain me login and logout scenarios in adf.

    Hi All,
                I want tutorial which explains step by step details to create login and logout pages and also store the values of user who logs in into database table. 
    Thanks in advance

    hi user,you can follow the below url it will explain the creating the login page and logout procedure..here part1 and part2 will be available in youtube
    ADF Training - Oracle ADF 11g Security - Custom ADF Login Form - Part 1 - YouTube

  • My 27" 2010 iMac  has recently began freezing and movement on the display is molasses slow. We have 500 gigabytes available and no applications running and the problems still persist. Any advice?

    My 27" 2010 iMac  has recently began freezing and movement on the display is molasses slow. We have 500 gigabytes available and no applications running and the problems still persist. Any advice?

    IF your system is running extremely slow with no applications running other than Finder then I'd suspect a failing HD or you have a runaway process somewhere. Open Activity Monitor (Applications - Utilities - Activity Monitor) and look to see if you have any applications taking a large %CPU, if you do that is your problem. To test the HD run Apple Hardware Test, please read:
    http://support.apple.com/kb/HT1509
    to learn how to run AHT on your machine, also run it in EXTENDED MODE so it does the most complete test. If no errors are found after the first pass run it another 2-3 times to be thorough.

Maybe you are looking for

  • Urgent help needed: how to display a list of records on the screen

    Hello, This is very urgent. Can anyone help me. I have posted this query of mine before also but still no reply came. My whole application is dependent on this problem. Actually I am developing an application for mobile phone using MIDP. I have a rec

  • Can't install a new version of iTunes

    I upragded my iPod, but now I can't install a new version of iTunes. Always when I'm trying to install it, it says I should write somekind of iTunes.msi path. So what should I do? And sorry about my bad english

  • Erro SOAP Receiver: handshake failure

    Pessoal, boa tarde. Tenho um Canal de Comunicação SOAP Receiver, com autenticação por usuário e senha. Ao enviar a requisição para o Channel, é gerado o seguinte erro: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <SAP:Error xmlns:SAP="h

  • FUTA Changes Effective 1st July 2011 - Not self Adjusting***Critical

    Hello As we know the FUTA rate was chnaged effective 1st July 2011 from 0.8% to 0.6%(after SUTA offset), we have noticed that currently in the SAP the FUTA contribution is not self adjusting. As illustrated in below example OCT 2011  Earnings 2008.13

  • How to configure new system landscape in portal server for bsp iview

    Hi     can you tell me what are the necessary parameters (apart form default parameters that were there while creating new system landscape) for configuring a system landscape for using it in bsp iviews. thanks & regards Ashutosh