注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 IB客座主编(四)美国西蒙公..
 帮助

PHP MySQL 与 MsSQL 中的事务


2008-04-30 10:39:57
MySQL:
//事务开始
mysql_query("SET AUTOCOMMIT=0");
mysql_query("BEGIN");
//事务回滚
mysql_query("ROLLBACK");
//事务提交
mysql_query("COMMIT");

MsSQL:
//事务开始
mssql_query("BEGIN TRANSACTION DEPS02_DEL");
//事务回滚
mssql_query("ROLLBACK TRANSACTION DEPS02_DEL");
//事务提交
mssql_query("COMMIT TRANSACTION DEPS02_DEL");




    文章评论
 
2008-05-14 09:59:19
按理来说,每种语言都是这样写,如java

     jdbcTemplate.execute("begin transaction t_customer_monitorEmail");
     try{
           ......
           jdbcTemplate.execute("commit transaction t_customer_monitorEmail");
     }catch(Exception e){
           jdbcTemplate.execute("rollback transaction t_customer_monitorEmail");
     }

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: