How to made a login to be saved on database

I'm new in JSP. And I really need a help with this one.
Suppose i made a login ( include password and name ) in JSP
1. how to made a database that save the name and password with JSP?
2. how can I save the login ( Pass and name ) in the database so I can made someone that not
register can't open my JSP page and only that register already can open my page?
Thanks for reading my question and help me solved my problem.

creates a database with columns username and password,
write a method in a JavaBean that gets queries the database for username and password,
In your jsp page call the bean to check it with the values in database. Here is a little code.
In jsp page
<%
     String username = request.getParameter("userid");
     String password = request.getParameter("password");
     boolean validLogin = conn.checkStudent(username, password);
     if(validLogin) {
%>
method In JavaBean
public boolean checkStudent(String un,String pw) throws Exception
     Statement stmt = con.createStatement() ;
     String query = ("SELECT firstName, password FROM student;");
     ResultSet rs = stmt.executeQuery(query);
     student=false;
     while(rs.next() && !student)
          String studentusername = rs.getString("firstName");
          String studentpassword = rs.getString("password");
          if(studentusername.equalsIgnoreCase(un) && studentpassword.equals(pw))     
               student=true;
               rs.close();
     return student;
hope this helps

Similar Messages

  • How to avoid multiple LOGIN with same user in database.

    Hi All,
    Using database triggers how to control multiple logins of a pertiuclar user.
    thanks in advance

    Don't forget to activate the RESOURCE_LIMIT parameter, which default is FALSE :
    alter system set RESOURCE_LIMIT = true;
    Laurent, I had a similar problem some time ago : I didn't want to avoid multiple access, but only control who was doing what. That's because moving from Client/Server to Web the TERMINAL column in V$SESSION becomes useless.
    I tried your solution, but I had to give up with it, because in my Forms9i application some forms call Reports, which generate a new session.
    I decided to use DBMS_APPLICATION_INFO, and this is satisfactory for my requirements, but I'm interested to discover other solutions.
    P.S. with my solution I'm able to limit accesses, because in the CLIENT_INFO string I put, among other things, the
    application user, so I can control if an user is already connected. The problem is that existing applications have to be modified .....:-(

  • How to get workspace login time from eng/dir database

    Hi All,
    I am trying to create performance report by checking user workspace login and logout time in oracle bpm 10g.
    I am not sure which engine/directory table holds history of user login.
    Please help me if you have any idea.
    Thanks
    Gaurav

    Hi,
    Pls search for "Managing Usage Tracking" in this "Framework Administrator's" guide.
    http://docs.oracle.com/cd/E17236_01/epm.1112/raf_webadmin/frameset.htm?launch_raf_admin.html
    I have not personally tried but heard of this. This can help you in giving the last login info' in a report format. But you have read the cautions (in the guide) when you plan to use this....
    Thanks,
    Siva

  • Does anyone here knows how to create a login page thru JDBC?

    Anyone here knows how to create a login page which connect to database thru JDBC but not JDBC-ODBC bridge?

    Hi..pls you'll do people here a great good if you could explain yourself better..!
    Anyway if you are trying to connect to an Oracle Database you dont need the jdbc-odbc bridge as oracle provides a special driver for java applets/applications that is "the thin driver" and the "oci driver"..so if you are connecting to Oracle your connection will look like this:
    Class.forName("oracle.jdbc.driver.OracleDriver"); //not sun.jdbc.odbc.JdbcOdbcDriver
    Connection con = DriverManager.getConnection ("blah blah, blah");
    no need for the jdbc-odbc bridge.
    I hope i've answered your question.
    Thanks.

  • I have a new computer and I want to use the "MasterPassword" again. How do I import all of the saved website passwords/logins from my old FireFox computer?

    I have a new computer and I want to use the "MasterPassword" again. How do I import all of the saved website passwords/logins from my old FireFox computer?

    A couple of methods.
    The first is to copy 2 files, key3,db and signons.sqlite from the profile folder of the old computer t the profile folder of the new computer. For details of how to find the profile folder see the [[profiles]] article.
    The second method is to install the [https://addons.mozilla.org/en-US/firefox/addon/2848/ Password Exporter] add-on on both computers and use that to export/import the passwords.

  • How do i stop workstation users from saving their network password or credentials for logging into a 2008 R2 Server workgroup?

    I have a small workgroup of about 30 users that are a mix of XP Pro, 7 Pro and 8.1 desktop / laptop users that connect to a Windows 2008 R2 Server to use Quickbooks Enterprise, share files and printers. I dont want the users to be able to save their password
    on their workstations, I want them to have to log in every time they connect to the server. How do I turn that off?Is the something on the server in Group Policy or a secruity setting that will not allow a saved credential for logging onto the server?

    Hi,
    I have a small workgroup of about 30 users that are a mix of XP Pro, 7 Pro and 8.1 desktop / laptop users that connect to a Windows 2008 R2 Server to use Quickbooks Enterprise
    By connecting to the server, do you mean users log on locally or through remote desktop services, or just through network to access network resources instead of log on to the server directly?
    If it’s log on locally, please disable auto logon feature by configure the registry entry
    AutoLogonCount to 0, it is under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
    If it’s remote desktop connection, please clear Logon Credentials for corresponding remote desktop sessions.
    If it’s network access, then it is by design because network logon has a single-sign-on feature.
    More information for you:
    How to disable Auto Login?
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/705b0cf8-53f1-45f9-b6bf-2ba61c8d10bf/how-to-disable-auto-login?forum=winservergen
    How Interactive Logon Works
    http://technet.microsoft.com/en-us/library/cc780332(v=WS.10).aspx
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • HOw do i revert to a previously saved version of a document?

    How do i revert to a previously saved version of a document? I have no idea how, but i closed and saved a document and the whole thing when reopened was blank (all 26 pages) apart from the last 4 pages id just added b4 saving. How do i get it back? Matter of life or death as hand in is tomorrow. thanks

    Have you backed up the document? For example, by using Time Machine. If you have then just need to restore the document from an earlier date (ie the latest date before 26 pages were deleted).
    If you haven't backed up the document then you're in trouble. The File > Revert to Saved menu command only undoes changes you made since the last time you saved your document.  As you saved the document with the 26 pages missing, choosing Revert will not get the 26 pages back.

  • How to make a login method for SAP Netweaver in java

    Hi
    Can anyone help me out to make a login() method that can be used to login to the SAP Netweaver server using a simple java code..........
    Hope a helpfull answers from u all....
    THANKS in ADV.
    Rupesh Khemka

    Hi Everyone
    I have made the login() method but i am facing the problem while making the resource context...Because in Resource Context it takes IUser of package
    com.sapportals.portal.security.usermanagement.IUser but I have got IUser of package com.sap.security.api.IUser ...while type Casting it with below code it is giving ClassCAstException.......
    public class NewSimpleServlet extends HttpServlet {
         protected void doGet(
              HttpServletRequest request,
              HttpServletResponse response)
              throws ServletException, IOException {
              StringBuffer s = new StringBuffer();
              try {String j_user="epuser";
                        String j_password="Abcd1234";
                        request.setAttribute("j_user", j_user);
                        request.setAttribute("j_password", j_password);
                        javax.security.auth.Subject subject;
    Set principals = UMFactory.getLogonAuthenticator().logon(request, response, "uidpwdlogon").getPrincipals();
    i have problem with getting IUser object from set of principals. In javadoc is written: "In order to get an IUser object from this subject, call Subject.getPrincipals() and iterate through the returned Set of principals." so i tried to iterate but i was not able to get that IUser with any casting. Do u know how it should be?
    IUser serviceUser = (IUser)subject.getPrincipals().iterator().next();
    Now in resource Context
    ResourceContext c = new ResourceContext(User);
    Here resource context need IUser type object as parameter...
    I also tried st like this
    loggedUser = UMFactory.getAuthenticator().getLoggedInUser(request, response);
    but loggedUser is not authenticated.
    Can Anyone Help me Out...
    Thanks
    Rupesh Khemka

  • How to save all login details with out asking to me...

    means how to store all login mail ids and passwords

    You will always have to confirm that you want to store a new name and password.
    *Saved Password Editor: https://addons.mozilla.org/firefox/addon/saved-password-editor/

  • HT4946 how can I make sure that itunes saved my contacts and photos on last back up ?

    How can I make sure that itunes saved contacts and photos FROM my iPhone on last back up ?, i just bought this phone and store transfer contacts from old non-smart phone and dont want to loose them !

    Look in whatever software on your computer handles your contacts and photos. Neither will be part of the backup file. This may be of help:
    http://support.apple.com/kb/HT1296
    Regards.

  • How can i recover my bookmarks and saved passwords?

    i have accidentally uninstalled Firefox software. how can i recover my bookmarks and saved passwords for the various sites. Please help on this regard. I'm in a serious trouble now.

    If you have removed your personal data when uninstalling Firefox then the Firefox profile folder that store your Firefox personal data has been removed.
    If you do not have a backup of the files in this folder then your only option is to try to recover this data with an undelete utility like Recuva.
    *Recuva: http://www.piriform.com/recuva
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How do I stop my MacBook Air saving every picture from web sites I visit

    How do I stop my MacBook Air saving every picture from any websites I visit mainly cars

    What browser are you using?
    Have you tried a different browser?
    Ciao.

  • How to move worksheet saved on database from one instance to another?

    Hi Every one,
    How to move worksheet or workbook saved on database from Discoverer plus from one instance to other instance?
    Is there any way to save a workbook or work sheet on to local drive from discoverer plus.?
    Thanks
    santhosh

    Hi,
    You have 2 options: use Discoverer Administrator to export/import the workbook; or use Discoverer Desktop to save the workbook to the local drive.
    You cannot save a workbook to the local drive using Discoverer Plus.
    Rod West

  • How many users can login via one Skype account

    Dear you,
    i am planning for my group which will use one Skype account so how many people can login with the same Skype account ?
    thanks for your seeing and help...
    Nguyen

    Hi Nguyen and welcome to the Skype Community,
    Share a Skype account between multiple users is not allowed. See http://www.skype.com/en/legal/tou/#4 (Highlighting in red done by me to emphasize relevant portions):
    4.1 Licence. Subject to your compliance with these Terms, you are granted a limited, non-exclusive, non-sublicensable, non-assignable, free of charge license to download and install the Software on a personal computer, mobile phone or other device; and personally use the Software through your individual Skype user account (“User Account”).
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • How to create a login interface in labview PDA module?

    How to create a login interface in labview PDA module? So that it checks with a list of usernames and passwords and allow to go to another VI?
    Anu

    Anu,
    I've attached a really short example that does something like what you're talking about.  It just compares the user's username and password a pre-determined username and password and then "logs the user in" based on that comparison.  Like Greycat said, you probably want to store this username and password info in some sort of file on the PDA that's in an encrypted format for both security and flexibility of your application.
    I hope this helps,
    Justin D.
    Applications Engineer
    National Instruments
    Attachments:
    LoginVI.vi ‏17 KB

Maybe you are looking for