|
楼主 |
发表于 2020-1-21 20:45:01
|
显示全部楼层
<% Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:xiaohai","sa","");
stmt=conn.createStatement();
String strSQL="insert into ProConsult ";
strSQL+="values(";
strSQL+="'"+projectname+"',";
strSQL+="'"+sort+"',";
strSQL+="'"+contactmen+"',";
strSQL+="'"+contactphone+"',";
strSQL+="'"+examarrange+"',";
strSQL+="'"+examrequire+"',";
strSQL+="'"+examtime+"',";
strSQL+="'"+profinish+"',";
strSQL+="'"+responsemen+"',";
strSQL+="'"+exammen+"')";
stmt.executeUpdate(strSQL);
stmt.close();
out.println("<font>工程信息如下:</font>");
out.println("<center><font size='3'>"+"工程注册成功,并成功发送到"+exammen+"</font></center>");
out.println("<table width='70%' border='1' cellspacing='1' align='center' bgcolor='#FFFFFF' bordercolorlight='#006633'><tr bgcolor='#ffffff'><td width='30%' height='25' align='right'>工程名称:</td><td height='25' width='70%'>");
out.println(projectname);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>类别:</td><td>");
out.println(sort);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>联系人:</td><td>");
out.println(contactmen);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>联系电话:</td><td>");
out.println(contactphone);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>勘察安排:</td>");
out.println("<td><input type='hidden' value='"+examarrange+"'>");out.println(examarrange);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>勘察要求:</td>");
out.println("<td><input type='hidden' value='"+examrequire+"'>");out.println(examrequire);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>勘察完成日期:</td><td>");
out.println(examtime);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>工程完成日期:</td><td>");
out.println(profinish);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>洽谈人:</td><td>");
out.println(responsemen);out.println("</td></tr>");
out.println("<tr bgcolor='#ffffff'><td align='right' height='25'>勘察人:</td><td>");
out.println(exammen);out.println("</td></tr>");
}catch(Exception e){out.println("<center><font size='3'>"+"工程注册失效.</font></center>");}
finally{
try{
if(stmt!=null){stmt.close();}
if(conn!=null){conn.close();}
}catch(SQLException e){}
}
%> |
|