日期:2014-05-19 浏览次数:20579 次
<% String teamName = new String(request.getParameter("fullName").getBytes( "ISO8859-1"), "UTF-8"); String userId = request.getParameter("userId"); Class.forName("net.sourceforge.jtds.jdbc.Driver") .newInstance(); String url = "jdbc:jtds:sqlserver://X.X.X.X:1433/sportSys"; String user = "sa"; String password = "123"; Connection conn = DriverManager.getConnection(url, user, password); //CallableStatement proc = conn.prepareCall("{CALL jianXiang('"+userId+"',' "+teamName+"')}"); CallableStatement proc = conn.prepareCall("{CALL jianXiang('9','男子')}"); ResultSet rs = proc.executeQuery(); ResultSetMetaData dm = rs.getMetaData(); %>
<%=userId %>(这个的值为9) <%=teamName %>(这个的值为"男子")