<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.io.*"%> 
<%@ page import="java.util.*"%> 
<%@ page import="java.sql.*"%> 
<%@ page import="javax.servlet.*"%> 
<%@ page import="javax.servlet.http.*"%> 

<%
    String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";  
    String sConnStr = "jdbc:odbc:try";//“try”的意思就是与刚才设置的数据源名对应; 
    Connection con = null;
    Class.forName(sDBDriver); 
    con = DriverManager.getConnection(sConnStr,"sa",""); 
    CallableStatement stmt=  con.prepareCall("{ call sp_adduserr (?,?,?,?) }" );
    stmt.registerOutParameter(1,Types.INTEGER,1);
    stmt.setString(2,"edmund");
    stmt.setInt(3,1);
    stmt.setString(4,"descption");
    stmt.executeUpdate();
    int userid = stmt.getInt(1);
    stmt.close();
out.println("输出的用户ID是:" + userid);
%>