我想实现通过对主键Id的输入 如果id的position为boss 则可以进入下一个界面
可是我的代码连输出都没有 不知道问题在哪里 help!!!
<%@page import ="java.sql.*" %>
<%@ page contentType="text/html" pageEncoding="utf-8" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
雇员管理系统Insert title here
<%
String driverName="com.mysql.jdbc.Driver";
String tableName="emp_information";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost/employee?useUnicode=true&characterEncoding=UTF-8","root","root");
Statement stat =conn.createStatement();
//SELECT emp_position FROM employee
.emp_information
;
try{
//ResultSetMetaData rmeta=rs.getMetaData();
out.print("<br>");
String Id=request.getParameter("Id");
String mm="select emp_position from`employee`.`emp_information` where`emp_id` = "+Id;
ResultSet rs=stat.executeQuery(mm);
//out.print(rs);
String position=rs.getString(6);
out.print(position);
%>
<%
stat.close();
conn.close();
}
catch(SQLException e) {
e.printStackTrace();
}
%>
</center>