在jsp中插入数据!access数据库
<%@page contentType= "text/html "%>
<%@page pageEncoding= "UTF-8 " language= "java " import= "java.sql.*,java.io.* "%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN "
"http://www.w3.org/TR/html4/loose.dtd ">
<%
try
{ Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");
Connection con =DriverManager.getConnection( "jdbc:odbc:card ");
Statement stmt = con.createStatement();
stmt.execute( "insert into user cardinfo ( 'a ', 'a ', 'a ', 'a ', 'a ', 'a ') ");
ResultSet rs = stmt.executeQuery( "select * from user where user_name= 'a ' " );
//String cardnumber = request.getParameter( "cardnumber ");
%>
<p> 恭喜!测试成功 </p>
<table width= "387 " border= "1 ">
<tr>
<td width= "200 "> 卡号 </td>
<td width= "200 "> 姓名 </td>
<td width= "200 "> 卡类型 </td>
<td width= "200 "> 余额 </td>
<td width= "200 "> 状态 </td>
</tr>
<% while(rs.next())
{ %>
<%-- <tr>
<td> <% out.println(rs.getString( "user_name ")); %> </td>
<td> <% out.println(rs.getString( "user_sex ")); %> </td>
<td> <% out.println(rs.getString( "user_age ")); %> </td>
<td> <% out.println(rs.getString( "user_address ")); %> </td>
<td> <% out.println(rs.getString( "user_homephone ")); %> </td>
</tr>
--%>
</table>
<%
}
rs.close();
stmt.close();
con.close();
&n