Results 1 to 2 of 2
  1. #1
    srinivas2939 is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default create login page and how to java application

    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import="java.sql.*" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <%
    String searchname=request.getParameter("name");

    %>
    <table align="center" border="1">
    <THEAD>
    <TR bgColor=#f3f3f3>
    <TH align=middle><B>EId</B></TH>
    <TH align=middle><B>EmpName</B></TH>
    <TH align=middle><B>EmpAddress</B></TH>
    <TH align=middle<B>EmpCity</B></TH>
    <TH align=middle<B>MobileNo</B></TH>
    </TR>
    </THEAD>

    <%

    Connection con=null;
    ResultSet rs=null;
    Statement stmt=null;
    try {
    //type4 driver
    Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
    con = DriverManager.getConnection("jdbc:sqlserver://Medjava04:1433;databaseName=MEDJAVA;user=sa");
    //type1 driver
    //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //con = DriverManager.getConnection("jdbc:odbc:MedJava;dat abaseName=MEDJAVA;user=sa");
    //Oracle type4 Driver
    //String url = "jdbc:oracle:thin:@computer-d219bd:1521:orcl";
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //Connection conn =DriverManager.getConnection(url,"system", "overmars11");

    } catch (Exception e) {
    System.out.println("exception " + e);
    con.close();
    }

    stmt=con.createStatement();
    rs=stmt.executeQuery("select * from employee where Empname like'"+"%"+searchname+"%"+"'");
    while(rs.next()){
    %>
    <TBODY>
    <tr>
    <TD align=middle ><%=rs.getString(1)%></TD>
    <TD align=middle ><%=rs.getString(2)%></TD>
    <TD align=middle ><%=rs.getString(3)%></TD>
    <TD align=middle ><%=rs.getString(4)%></TD>
    <TD align=middle ><%=rs.getString(5)%></TD>
    </tr>
    <%}
    rs.close();
    stmt.close();
    con.close();
    %>
    </TBODY>
    </table>
    </body>
    </html>

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <form action="search.jsp">
    <table align="center">
    <tr>
    <td>
    Enter Data to Search:<input type="text" name="name" />
    <input type="submit" value="Submit" />
    </td>
    </tr>
    </table>

    </form>
    </body>
    </html>

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: create login page and how to java application

    Was there a question you forgot to ask?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Java - Swing - LOGIN Page
    By jim in forum AWT / Swing
    Replies: 2
    Last Post: 10-10-2011, 09:29 AM
  2. need help to create login machanism for web application
    By nikhil.engineer.ec in forum New To Java
    Replies: 2
    Last Post: 12-15-2010, 12:08 PM
  3. Java Login Page
    By turkuaz07 in forum Advanced Java
    Replies: 1
    Last Post: 03-14-2009, 09:18 PM

Posting Permissions

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