欢迎加入站点基地设计开发交流群:30720409
详细内容
jsp执行存储过程
发布日期:2010-03-11     点击:2428     字体:[ ]

Class.forName("net.sourceforge.jtds.jdbc.Driver");     
    
String   dsn="jdbc:jtds:sqlserver://localhost:1433/SZ_MOTION;user=sa;password=sa";     
    
Connection   conn=DriverManager.getConnection(dsn);  

  CallableStatement callstmt;
  conn.setAutoCommit(false);
  callstmt = conn.prepareCall("{call MOTION_Works_Get(?)}");

  callstmt.setString(1,"80");
  ResultSet rsCall = callstmt.executeQuery();
 
  while (rsCall.next())
  {out.println(rsCall.getString("oid") + "--" + rsCall.getString("Title") + "---" + rsCall.getString("Content") + "<br/>");}
 
  rsCall.close();
  conn.commit();
  callstmt.close();
  conn.close(); 

用户评论
昵称 
内容  *
验证码   
   
相关文章 更多...  
Copyright © 2010 zdbase.com All Rights Reserved. 苏ICP备15039389号-1 可人软件设计