`
- 浏览:
493631 次
- 性别:
- 来自:
济南
-
- import java.sql.CallableStatement;
-
import java.sql.Connection;
-
import org.apache.log4j.Logger;
-
import org.hibernate.classic.Session;
-
-
import com.check.base.BaseHibernate;
-
import com.check.collection.dao.CollectionDao;
-
-
public class CollectionHibernate extends BaseHibernate implements CollectionDao {
-
private Logger logger = Logger.getLogger(CollectionHibernate.class);
-
-
-
public boolean getOBData(String oldtime,String citytype, String cityType, String deptmentIds) throws Exception {
-
-
-
logger.info("CollectionHibernate getOBData is Begin...");
-
boolean bool = false;
-
CallableStatement stmt = null;
-
Connection conn = null;
-
Session session = null;
-
try{
-
session = this.getHibernateTemplate().getSessionFactory().openSession();
- conn = session.connection();
-
stmt = conn.prepareCall("{call Proc_GETLINKDATA(?,?)}");
-
stmt.setString(1,oldtime);
-
stmt.setString(2,citytype);
- stmt.execute();
-
-
if (deptmentIds.length() > 0) {
-
stmt = conn.prepareCall("{call DATADELETEBYDATEANDDEPT(?, ?, ?)}");
-
stmt.setString(1, "");
-
stmt.setString(2, deptmentIds);
-
stmt.setString(3, cityType);
- stmt.execute();
- }
-
- conn.commit();
-
bool = true;
-
}catch(Exception e){
- e.printStackTrace();
- conn.rollback();
-
}finally{
-
if (session != null) {
- session.close();
- }
- }
-
logger.info("CollectionHibernate getOBData is End...");
-
return bool;
- }
-
- }
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
hibernate存储过程 请大家给点意见一起学习
hibernate调用存储过程,好东西可以看看
Hibernate 存储过程的调用.doc
在hibernate中使用存储过程,调用存储过程
java调用hibernate存储过程详细介绍,各种配置方法,还有与jdbc调用存储过程二者之间的对比。
也可以通过存储过程来执行批量更新。存储过程直接在数据库中运行,速度更加快。在Oracle数据库中可以定义一个名为batchUpdateStudent()的存储过程。
使用hibernate的query调用oracle的存储过程/function,包含例子,源码以及数据库文件
hibernate本对数据库的操作有些不完美,有必要的时候可以调用存储过程来补足。
前几天一直在搞spring+hibernate执行存储过程的技术,在网上查了很多资料没有一个是完全的能执行的,代码简单但,几天时间比较辛苦,所以要分多了点。由于包都太大,所以删掉啦!
hibernate调用存储过程的方法,里面有典型的例题,欢迎大家下载
很好的hibernate开发技术,使用hibernate调用存储过程!
hibernate自动生成entity,映射文件,dao.等
hibernate 3.1 存储过程 实现例子.全过程.. 源码下载
在hibernate中调用oracle中的存储过程的详细代码。可以借鉴使用,帮助学习。
hibernate环境搭建已经对应存储过程调用