e代剑客——温柔一刀

生活就像海洋,只有意志坚强的人,才能到达彼岸

   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  76 随笔 :: 7 文章 :: 215 评论 :: 0 Trackbacks

 

<% // 调用存储过程更新记录
 
String  procedure_name = " update_user_data " ; // 执行的存储过程名称
 
String  call_procedure_string = " {call  " + procedure_name + " (?,?,?,?,?,?,?)} " ; // 调用存储过程的语句
 try 
    { Connection con;
      Statement sql;
      ResultSet rs;
      Class.forName(
" com.microsoft.jdbc.sqlserver.SQLServerDriver " );
      con
= DriverManager.getConnection( " jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=testDatabse " , " sa " , " 6599996 " );
      CallableStatement callable_statement 
=  con.prepareCall(call_procedure_string); // 创建对象
      
// 设置调用存储过程的参数
      callable_statement.setString(
1 ,username);
      callable_statement.setString(
2 ,usertruename);
      callable_statement.setInt(
3 ,ageint);
      callable_statement.setString(
4 ,sex);
      callable_statement.setString(
5 ,address);
      callable_statement.setString(
6 ,telephone);
      callable_statement.setLong(
7 ,user_id);
      callable_statement.executeUpdate();
      con.close();
    }
 catch(SQLException e1) 
    {
      
/ ut.print( " SQL异常! " );
    }
%>
posted on 2006-04-25 18:18 温柔一刀 阅读(229) 评论(0)  编辑  收藏 所属分类: java相关

只有注册用户登录后才能发表评论。


网站导航:
 
联系偶 zhupanjava@gmail.com 温柔一刀