Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Login/Registration system in JSP

  • 20-02-2006 04:59PM
    #1
    Registered Users, Registered Users 2 Posts: 463 ✭✭


    I'm currently trying to setup a website with a login system.
    The site is being done completely in JSP.
    I'm using MYSql as the database.

    I want users to be able register their details and then login with their chosen username and password to access information from the database specific to their account.

    I'm using Apache Tomcat as our server.
    There's a tutorial here for creating a similar system under Geronimo & Derby SQL, but I'm not sure if it's merely a case of altering this to work with MySql:
    http://www-128.ibm.com/developerworks/opensource/library/os-ag-logreg2/#fig2

    I changed:
    driver = (Driver) ([B]com.ibm.db2.jcc.DB2Driver.class[/B]).newInstance();
                } catch(Exception e) {
                    throw new IllegalArgumentException("Unable to load, instantiate, or register driver "+
                                                       driver+": "+e.getMessage());
                }
                
                try {
                    Properties prop = new Properties();
                    prop.put("user", "system");
                    prop.put("password", "manager");
                    Connection conn = driver.connect("jdbc:derby:net://localhost:1527/SystemDatabase;", prop);
    
    to:
    driver = (Driver) ([B]com.mysql.jdbc.Driver[/B]).newInstance();
                } catch(Exception e) {
                    throw new IllegalArgumentException("Unable to load, instantiate, or register driver "+
                                                       driver+": "+e.getMessage());
                }
                
                try {
                    Properties prop = new Properties();
                    prop.put("user", "actualdbusername");
                    prop.put("password", "actualdbpassword");
                    Connection conn = driver.connect("jdbc:mysql://localhost/jspod;", prop);
    
    Am I barking up the wrong tree?
    Thanks


Advertisement