在Hibernate中用jdbc做存储过程
来源:优易学  2010-1-15 12:30:23   【优易学:中国教育考试门户网】   资料下载   IT书店

     package com.rxtc.bi.app.crm.rep.dao.impl;
  import java.sql.CallableStatement;
  import java.sql.Connection;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import javax.sql.DataSource;
  import org.springframework.orm.hibernate3.SessionFactoryUtils;
  import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
  /**
  *
  *

    * Title:在hibernate中用存储过程

  * 只是要绕过hibernate 调用jdbc API,当然事务还是由hibernate业管理:

 

  假如我们创建了以下存储过程:


 create or replace procedure batchUpdateCustomer(p_age in number) as
  begin
  update CUSTOMERS set AGE=AGE+1 where AGE> p_age;
  end;

  存储过程中有一个参数p_age,代表客户的年龄,应用程序可按照以下方式调用存储过程:

[1] [2] 下一页

责任编辑:cyth

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训