<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>阿</title>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<%
  String no = request.getParameter("sno");
  String name = request.getParameter("sname");
  String isfree = request.getParameter("isfree");
  String skills = request.getParameter("skills");
  String wants = request.getParameter("wants");
  String telnum = request.getParameter("telnum");
  if (no.equals("") || name.equals("") || isfree.equals("") || skills.equals("") || wants.equals("") || telnum.equals("")) {
%>
<jsp:forward page="error.jsp"></jsp:forward>
<%
  }
      Connection conn = null;
  Statement stmt = null;
  try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(
        "jdbc:oracle:thin:@localhost:1521:nocoo",
        "jbuser",
        "abc");
    stmt = conn.createStatement();
    stmt.executeUpdate("INSERT INTO SKILLS VALUES('" + no + "','" + name + "','" + isfree + "','" + skills + "','" + wants + "','" + telnum + "');");
    stmt.close();
    conn.close();
  }
  catch (SQLException e) {
    e.printStackTrace();
  }
  catch (ClassNotFoundException e) {
    e.printStackTrace();
  }
//ok  
%>
</body>