<%-- 
    Document   : eedit2
    Created on : Mar 21, 2010, 8:24:28 PM
    Author     : Sreekanth
--%>

<%@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">
<jsp:include page="menu.jsp"></jsp:include>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script>
            function fun()
            {
                document.forms["f1"].submit();
            }
        </script>
    </head>
    <body bgcolor="bisque">
       <%@page language="java" import="java.util.*,java.sql.* " contentType="text/html"%>

<%             // String a= request.getParameter("QosType");
               // String b= request.getParameter("op");

           String a1 =request.getParameter("id");
                
              
               
           String id=""; 
           String name="";   
           int sal=0;
           String div="";   
           String tid="";                              
	   int marks=0;   
           int per=0;
           String cgrade="";   
           String pgrade="";
           int exp=0;
           
           try {  
            
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           
               Connection con=DriverManager.getConnection("jdbc:odbc:sree","sree","sree");

           
            
                PreparedStatement pstmt = con.prepareStatement("select * from emp where id='"+a1+"'");
                    
                 ResultSet rs= pstmt.executeQuery();
                
            while(rs.next())
            { 
              String a=rs.getString(1);
              id=String.valueOf(a);    
              String b=rs.getString(2);
              name=String.valueOf(b);
              int c=rs.getInt(3);
              sal=Integer.valueOf(c);
              String d=rs.getString(4);
              div=String.valueOf(d);
              String e=rs.getString(5);
              tid=String.valueOf(e);
              int f=rs.getInt(6);
              marks=Integer.valueOf(f);
              int g=rs.getInt(7);
              per=Integer.valueOf(g);
              String h=rs.getString(8);
              cgrade=String.valueOf(h);
              String i=rs.getString(9);
              pgrade=String.valueOf(i);
              int j=rs.getInt(10);
              exp=Integer.valueOf(j);
                                                                                                                                                      
            }
                 
            }
	catch(ClassNotFoundException s)
        { 
	out.println("loaderror");
   	}
		catch(SQLException e)
        { 
	out.println(e);
   }
                       
          %> 
       <form name="f1" action="empedit3.jsp" method="POST">
       <center>

     <table border="1">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Enter Employee ID</td>
<td></td>
<td><input type="text" name="id" value="<%= id %>" size="35"  /></td>
<td></td>
</tr>
<tr>
<td>Enter Employee Name</td>
<td></td>
<td><input type="text" name="ename" value="<%= name %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Employee Salary</td>
<td></td>
<td><input type="text" name="esal" value="<%= sal %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Employee Divison</td>
<td></td>
<td><input type="text" name="div" value="<%= div %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Test ID/Name</td>
<td></td>
<td><input type="text" name="tid" value="<%= tid %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Test Marks</td>
<td></td>
<td><input type="text" name="marks" value="<%= marks %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Test Aggregate</td>
<td></td>
<td><input type="text" name="agg" value="<%= per %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Experience</td>
<td></td>
<td><input type="text" name="exp" value="<%= exp %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Current Grade</td>
<td></td>
<td><input type="text" name="cgrade" value="<%= cgrade %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td>Enter Promoted Grade</td>
<td></td>
<td><input type="text" name="pgrade" value="<%= pgrade %>" size="35" /></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="button" value="UPDATE" name="ok" onclick="fun()" /></td>
<td></td>
</tr>
</tbody>
</table></center>

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