How to allow a user to view records belonging to them only...!

Hi guys,
I have a login page written in jsp. When users login, the login servlet check for username and password, then it takes them to a main page. From the main page, users can decide to view all the records that they have already submitted by clicking on the "view" button.
So far, right now when users click on that "view" button, they are able to view all the records in the database and that's not what I want. I want users to only view the records they have submitted.
Does anyone know how to do...??
Thanks...

Yeah...right...
public void doGet (HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException {
           String username = request.getParameter("username");
           String password = request.getParameter("password");
           if (login (request, response, username, password)) {
                response.sendRedirect("/WepApplication/Files.jsp");     
        public void doPost (HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
           doGet(request, response);
        public boolean login (HttpServletRequest request, HttpServletResponse response, String user, String password)
        throws ServletException, IOException{
           try {
              Statement statement = connection.createStatement();
              String sql = "SELECT userID, login FROM User" + " WHERE login='" + user + "'" + " AND pass='" + password + "'";
              ResultSet resultSet = statement.executeQuery(sql);
              if (resultSet.next()) {
                  int userId = resultSet.getInt(1);
                  String id = Integer.toString(userId);
                  HttpSession session = request.getSession();
                  session.setAttribute("user", id);
                  System.out.println("user is = " + session.getAttribute("user"));
                 resultSet.close();
                 statement.close();
                 return true;
              resultSet.close();
              statement.close();
           } catch (SQLException e) {
              System.out.println (e.toString());
           } catch (Exception e) {
              System.out.println (e.toString());
           return false;
        }

Similar Messages

  • HT2688 Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared librar

    Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared library?

    Was your wife logged into the libray at the time you tried to log in? I have had a similar problem and it was because another user was logged into the library when I attempted to. I got the permission denied banner.

  • Limited-access user permission lockdown mode and allowing anon users to view list items

    I'm working on setting up a public-facing SharePoint website that will need to support anonymous user access. I'm using the Enterprise Publishing Portal site collection template, so the Limited-access user permission lockdown mode feature is turned on.
    Everything is working great, except allowing users to view a list item. One of the key features I was hoping to leverage was the ability to display custom lists on a web page using a List View web part. Then they could click on an item and see the DispForm.aspx
    so the item's content was accessible, including any file attachments.
    A real-world example is adding an RSS viewer web part to the home page and allowing anon users to click on one of the events to see the details of it. Currently, in lockdown mode, the users gets an authentication prompt. 
    I toyed with the idea of turning the lockdown feature off. However, I'm uncertain of the full impact that would have on security. For example, I know it will allow anonymous users to see who created and modified an item, which we don't want exposed to the
    public (i.e. our employee names). Seems like opening a can of worms by disabling the lockdown mode... 
    Any ideas on how to tackle this would be greatly appreciated.

    So far, this is the most promising solution I've come across:
    http://soerennielsen.wordpress.com/2012/05/29/how-to-make-list-items-visible-to-anonymous-users-in-search

  • How to allow multiple users login to a MAC PRO without interruption?

    I have a mac pro, which runs Yosemite, (2013 module) to be used as a server. However, I have difficult to let multiple users to use the mac simultaneously.
    Objective:
        One person uses the mac directly on his desktop, while the others to login remotely though VNC from PC (win 7/Linux).
        The users have their own workspace, and they will not interrupt each other.
    What I tried:
        I created two mange accounts on the MAC.
        Account 1 was used to directly login on the mac desktop.
        Account 2 was used to login to the mac from a PC though VNC. (I also tried this from a Centos workstation with the Tiger VNC viewer)
    Problem:
    When account 2 is login, the location monitor will automatically change to that account as well. Both accounts shared exactly the same screen, mouse & keyboard actions. It is impossible to let multiple users to use the MAC pro simultaneously without interruptions.
    If I use "hdiutil attach" to mount a dmg file though SSH with account 2, the folder will automatically show in the local desktop login with account 1.
    Question:
    I read something about the "Per-user screen sharing". It says, "You can remotely log into a Mac with any user account on that computer and control it, without interrupting someone else who might be using the computer under a different login." Is it possible to do this from a PC or Linux client?
    If the problem is simply due to the poor functionality of the build-in VNC service in Yosemite, I appreciate your help to suggest some other decent VNC server for Yosemite. I know the Vine Server (OSXvnc), but I failed to install it on the mac because it is incompatible with the Yosemite.
    Does the SSH is supposed to work in this way in OSX? I mean the local account can see the folder mounted by another account though SSH.
    If any specific version of Yosemite is required to allow multiple users to access a mac simultaneously? Just as the win 7 professional allow only one user to login in at each time. But with the remote desktop server of windows, multiple users are able to use the same computer at the same time without any problem.
    If you familiar with any of the above questions, please help. Any comments and suggestions are appreciated.
    I know the best way to get the solution is to direct call the apple support. However, it is really not easy to call them. Because it always results with long waiting time and then the people pick up the phone will transfer my call to an expert who will make me to describe the problem again.
    Since I'm not interested in the technique details of all the problems, it is also grateful if you would provide a direct instruction to let me setup the computer for the purpose.
    Thanks you very much for your kindly help.

    I cannot help with the screen sharing, although I have just tried it with a RealVNC client on an iPad and it seemed to work OK.
    However on the disk showing on all users desk tops have you unchecked the "ignore ownership on this volume" check box? You can check the drives permissions with CMD i command.

  • How to allow a user to select an instrument from a group and use that VI?

    Hi All,
    In a previous application I wrote using Agilent VEE I created a Configure Equipment and Initialise Panel for the user to select for example a signal generator from a drop down list of different types, and when initialised the functions for that item would loaded into a generic library called Signal Generator into my main program. I could then call these functions in my main program
    When I wrote the instrument drivers I named each function the same for each type of signal generator I could offer the user. e.g. Set_Frequency (would be in all instrument drivers)
    I would like to do this in LabVIEW and am struggling to find out how to do it.
    Does anyone have any suggestions? And I hope what I have said above makes sense.
    TIA
    Martin

    Hi Martin,
    With regards to communicating with hardware
    from other manufacturers, yes you are able to do this using LabVIEW
    provided the drivers are available from National Instruments, or
    sometimes the manufacturers themselves provide LabVIEW VIs to use with
    their instruments.
    To configure the device it may be worth
    implementing some form of popup dialog box to input the values for your
    particular configuration. This can be done by creating a SubVI where
    you are able to input the values and once a button is pressed the
    dialog box closes (as in the example I have attached)
    Just to
    mention also, VI Libraries are mainly for organization purposes, and
    grouping VIs together. It also allows you to protect your VIs by
    setting them to private, which means they are only able to communicate
    with other VIs within that particular library.
    Hope this Helps,
    Steve
    Attachments:
    Popup Example.vi ‏16 KB

  • How can I allow a user to control my Edge Animation using only the scrollbar?

    I have seen a few examples of an Edge Animation being conrolled by the scrollbar, and I am wondering how I could achieve the same effect.
    Example:
    http://dominikruckli.ch/scrolltest/scrolltest.html
    I have searched the corners of the internet and have found 2 or 3 different tutorials, but none of them have proven successful.
    In basic terms, I am creating an animation that involves a character getting from Point A to Point B, from the beginning of my timeline to the end.
    Rather than exporting my animation so that it plays automatically, by itself, I would like for a user to scroll vertically, and the playing of the animation moves in conjunction with the scroll bar.
    As the user scrolls from top to bottom on the scrollbar, the character in my animation moves from Point A to Point B.
    Also, if the user stops scrolling... the character will stop moving as well.
    In addition, I would like the surrounding area, outside of my stage, to remain hidden. I do not want to allow the user the ability to scroll around and see off of my designated stage area. I only want the scroll bar to act as a playhead for the animation.
    Any help will be greatly appreciated.
    Thank you
    Note:
    If you have special CSS (or other form of Code), please provide specific instructions on how to insert this code, where it should be located, what part(s) of the code should be altered, and any additional instructions on how to apply any form of coding. (Screenshots would be amazing)

    Never mind.  I figured it out myself.  I changed the myComp.play("scenefour"); to myComp.getStage().play("scenefour"); and it worked fine. 

  • How to allow domain users to customize page Size in Adobe PDF printer.

    Hi all,
    I am not able to customize page size in Adobe PDF printer when I logged in with Domain user login. But I am able to Customize PDF printer in admin Login.
    I need a solution to allow Domain users to customize page size for Adobe PDF printer.
    Looking for a solution ASAP
    Regards
    Nagesh

    Oops, I misread your question, so I edited my response.

  • How to allow the user to upload a file from their desktop to MII Server?

    Hi,
    Is there a way for the user to specify a file on their local computer to upload to the MII server for processing?  We have a method that works for uploading from a shared network drive, but now the need/desire is to allow the user to upload a file from their desktop.
    Ideally, this would be a file browser that the user would click on to browse their local desktop and select the file and click "Upload" but not sure what's possible?
    This is using 12.1 SP4.
    Thanks for the help.
    Kerby

    [Uploading Documents|Uploading Documents]

  • How to allow a user to create his workspace in java(swings)

    hello guys ..
    i have to develop an interface (GUI) where i allow the user to create his own workspace , could anybody tell me what is the code we need. are there any specific inbuilt functions and methods..
    please help
    Imran

    public class Workspaceextends javax.swing.JPanelimplements org.jivesoftware.smack.PacketListener
    The inner Container for Spark. The Workspace is the container for all plugins into the Spark install. Plugins would use this for the following:
    Add own tab to the main tabbed pane. ex.
    Workspace workspace = SparkManager.getWorkspace(); JButton button = new JButton("HELLO SPARK USERS"); workspace.getWorkspacePane().addTab("MyPlugin", button);
    Retrieve the ContactList.

  • How to restrict payroll users from viewing IT0002 or other personnel data?

    Hi,
    We need to device a authorization for payroll users in such a way, that they are allowed to access and edit  IT 0014, IT0015, IT0580 to IT591 but they are not even allowed to view infotype IT0000 to IT0007.
    They will still be allowed to do payroll processing of all employees.
    Problem is - if we disable PA20 to PA40 transaction for these users, then they will not be able edit IT 14, 15 etc and vice-versa.
    Please advice how can we do this.
    Effective solutions will rewarded

    Am just wondering like this -
    for a User who will update IT8 etc infotypes and run payroll for all employees:
    Allow infotype access to all Infotypes via P_ORGIN/P_ORGINCON and then
    exclude Infotype access to IT0000 to IT0007 via P_ORGIN/P_ORGINCON
    Does Payroll run after the above if executed by this employee? because in my view the user has access to IT08 and other payroll related infotypes and hence should run (but I think IT0, IT1 &2 might also be required for for various reasons for payroll to run - not sure);
    Or probably you might need to think of executing/triggering the Payroll process via Batch process (thru a batch user Id which has access to all)...because it wont be a best practice to have manually initiate the Payroll process...
    Regards
    Chandra
    Message was edited by:
            Chandramouly V

  • How to allow Sharepoint users to login from multiple parent-child accounts?

    Our client has mutliple AD domains and wants to allow people which have multiple AD accounts in multiple domains to login as THE SAME user:
    - only primary account will be visible in search
    - there will be only one user profile with all informations gathered from all sub accounts
    - permissions for the sub account will be in sync with parent account
    - task generated for parent will be visible for child accouns too etc
    - ad admin can link the account together in the Active Directory - this link is permament (even if we move users to another OU) and ad admin can define which account is primary and secondary (parent/child)
    How we can implement this in Sharepoint 2010 Std Server?

    Everything in SharePoint keys of the Security Identifier (SID) of a user.  Each user in a domain has a unique SID, so there is no way to have multiple users recognized in SharePoint as the same user.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • How to restrict some users from viewing a screen of standard transaction

    Hi All,
    I need to restrict certain user ids from viewing the 'Payment Transactions' screen for the below mentioned transactions.
    FK01, FK02, FK03, MK01, MK02, MK03, XK01, XK02, XK03
    The Basis consultant has tried to configure it. However its not working. So need to find other solution.
    For all transactions other than FK01, MK01, XK01 (create vendor), the BAdi GOS_SRV_SELECT is called before the payment transaction screen appears. But for transactions FK01, MK01and XK0, no such BAdi is there.
    Also I'm not able to figure out how to restrict that particular screen using Badi GOS_SRV_SELECT. What will be the service name for this?
    Please help !!!
    Thanks in advance,
    Radhika

    hi,
    u can do this using user exits.
    identify the appropriate exit for ur transaction and thn put condition like
    if username = ...
    loop at screen.
    hide..
    endloop.
    i was just trying to give u some hint .make it to ur best.
    reward if hlpful.

  • How to force the users should enter records in detail block.

    Hi members,
    we have a master-detail form. ex like DEPT (master), EMP(detaisl multi record). after entering new dept, i want the users shoudl not leave with out EMP entries for that new dept. how can we achieve this.
    thanks in advance

    In Pre-insert trigger of Master block just check if there are any records in the detail block before commiting the record. If not found then Raise A Excepiton.

  • How to allow CS users to update metadata on several items? (UCM 10gR3)

    In the UCM 10gR3 portal user interface:
    It is convenient for us to allow users to update metadata fields on a group of items in one action. We want to allow users to select any number of files from a CS search result.
    After selecting the items, we want to users to be able to set new values for some fields (e.g. Security Group and Document Type) without touching the values of the other metadata fields (such as Author).
    This seems to be pretty basic functionality, but we cannot seem to find it in the CS user interface. What is the easiest way to do this in the CS user interface?
    Thanks!

    Unfortunately freezing the metadata model is not an option in practice. While we may make a model that serves us well for the time being, we are likely to end up in a situation where the outside world invalidates our metadata model.
    A hypothetical case
    From the UCM Administration Manual:
    "Choose only static information as a security group. For example, department names change infrequently, so they can be considered static; projects come and go, so they might not be considered static."
    Although department names may change infrequently, they are likely to change sometimes. Sometimes departments are split up or merged.
    A real case
    In our concrete case, a project will generate a large amount of content distributed over many content items. After the production of this content within the project the responsibility will be transferred to a number of different departments. It is thus impossible to know in advance which metadata model will be suitable and it seems that the archiver is inefficient in solving the problem of delegating the content to different security groups.
    Obviously, we are not interested in making heavy customization that we need to maintain. And reassigning the security group of many content items individually is not a feasible solution.
    Has anyone had similar needs? What solutions have you used?

  • How to find the user who created record on PA_TRANSACTION_INTERFACE_ALL ?

    We are trying to develop a custom workflow to send Project WebADI transactions through workflow approval. My problem is, from the PA_TRANSACTION_INTERFACE_ALL table where the interface records are populated, I cant find the user responsibile. (Notification will be sent to the creator's manager)
    What we planned for the design is:
    Disable the import program being run from WebADI Screen. This ensures data stays in PA_TRANSACTION_INTERFACE_ALL  and does not go to PA_EXPENDITURES_ALL Etc.
    Looking at the data, send notifications. When the approval is given, run the import program to send the data to PA_EXPENDITURES_ALL Etc.
    We were also going to remove the import program from the custom responsibilities so that users dont run it.
    First, we had to disable the Import program being run from the WebADI screen. We did this by editing the integrator. Now when the data is imported into this table ,we can see many columns do not have data. CREATED_BY etc are populated only if the import program runs. But if it runs then already transactions have gone in and approval process is meaning less.
    Only thing that looks like it could be useful is TXN_INTERFACE_ID but I cannot find another place where it will link to. 
    Could you help us find a way to find the creator of the data in PA_TRANSACTION_INTERFACE.

    Hi
    I don't know the answer to your question, but thought of suggesting another approach.
    Leave the original import program in the integrator of the WebAdi.
    Develop a logic into Transaction Import Client Extension. There you can find the data that Oracle has already populated for the created by column, and you may trigger the notification submission for approval. Use the extension to alter the transaction status so it will not be actually interfaced, until you get the approval response.
    Dina

Maybe you are looking for

  • Safari keeps crashing/re-loading when using hotmail to compose messages

    I finally convinced my husband... after years of begging to buy me a new Mac and switch from using a PC. Now that I have transferred all our data over to our new iMac (which was purchased on 4/2/10--so it is a very new) and we are ready to make our i

  • Itunes cannot connect to iphone because iphone is locked and in lost mode

    what should i do as the message on computer read as ''itunes cannot connect to iphone because iphone is locked and in lost mode''

  • Material without inspection setup goes to quality inspection

    Hello Gurus We have material without inspection setup, but the system say the stock type is Quality Inspection. Then we get problems in the goods receipt. We checked the PO has stock type quality inspection, how can we solve this situation?, please g

  • Ascii to I16

    Hi, I'm reading data in from a little robot and want to convert the data into an I-16 number.   I have attached a picture of the piece of code to which I'm referring.  Oftentimes the numeric value of the returned ascii data is 255 which is not correc

  • Essbase cubes - best cache setting

    We implemented Essbase about 2 years ago. We have never reset our cache settings. We are experiencing slowness in our cubes. Could this be caused by our cache settings? Do we need to reset our cache setting every so often. Thanks. Below are our curre