Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Jsp login

  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Jsp login

    Wondering If any one know what to do to the spassword to compare to the ID

    <%
    String sPassword=request.getParameter("studentName");
    %>




    <%
    DataSource dataSource = new
    SingleConnectionDataSource("jdbc:mysql://localhost/db","blank", "password", false);


    JdbcTemplate template = new JdbcTemplate(dataSource);
    List userList = template.queryForList("select ID from staff ");
    if(sPassword.equals(""))
    {
    out.println("success");
    }
    else
    {
    out.println("erroe") ;
    }


    %>

  • #2
    New Coder
    Join Date
    Jan 2011
    Location
    India
    Posts
    31
    Thanks
    0
    Thanked 4 Times in 4 Posts
    I think you need to understand first, what you want to do.
    It looks like a crappy code for me.

    Explain your requirement properly.

    you can try out contain method in list interface to compare. But you logic looks like nonsense to me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •