<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030" import="java.sql.*"%> Insert title here <% try { String chewei_no=new String(request.getParameter("chewei_no").getBytes("ISO-8859-1"),"GB18030"); String chewei_type=new String(request.getParameter("chewei_type").getBytes("ISO-8859-1"),"GB18030"); String chewei_state=new String(request.getParameter("chewei_state").getBytes("ISO-8859-1"),"GB18030"); String chewei_didian=new String(request.getParameter("chewei_didian").getBytes("ISO-8859-1"),"GB18030"); Connection con=reg.getCon(); String sqlt="select * from chewei where chewei_no='"+chewei_no+"'"; ResultSet rs=reg.GetRs(sqlt); if(rs.next()){ out.println(""); } else { // 添加信息的SQL语句 String sql = "insert into chewei(chewei_no,chewei_type,chewei_state,chewei_didian) values('"+chewei_no+"','"+chewei_type+"','"+chewei_state+"','"+chewei_didian+"')"; int row = reg.GetCount(sql); if(row > 0){ out.println(""); } con.close();} } catch (Exception e) { out.print("车位添加失败!"); e.printStackTrace(); } %>