使用Hibernet开发informix数据库程序小结

使用Hibernet开发informix数据库程序小结

 

1、              数据库transaction模式修改

Informix数据库默认创建的时候是不支持事务的,可以通过修改数据库的日志模式来进行开启。

ontape -s -B hr360db

有其他应用连接着数据库时,会出现”Error changing logging status - 'console'. iserrno 107.

参考:http://blog.csdn.net/lysanderk/article/details/5338435

2、              生成domain.hbm.xml注意的地方

Informix不支持在实体类中类似schemacatalog加在执行语句中。生成的SQL语句会类似于insert into hr360db.xxjsb.user360的模式,需要去掉domain.hbm.xml文件中的

schema="xxjsb" catalog="hr360db"

不然会出现-201语法错误

3、              配置数据库执行脚本显示

将下列脚本添加到hibernet.cfg.xml文件中

<property name="hibernate.show_sql">true</property><!--显示的sql语句格式化-->

<property name="format_sql">true</property><!--使显示的sql语句-->

可以在输出下看到输出语句

参考内容:http://hi.baidu.com/yby0260/blog/item/1088b8126ee30f8c6438db21.html

4、              No CurrentSessionContext configured!" 异常解决方案

在在hibernate.cfg.xml中加入:

<property name="current_session_context_class">thread</property>

参考内容:http://blog.csdn.net/daryl715/article/details/1507385

posted on 2012-03-15 08:59  星星博客园  阅读(324)  评论(1编辑  收藏  举报

导航

立即注册PayPal并开始接受信用卡付款。