使用Hibernet开发informix数据库程序小结
2012-03-15 08:59
239 查看
使用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不支持在实体类中类似schema和catalog加在执行语句中。生成的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
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不支持在实体类中类似schema和catalog加在执行语句中。生成的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
相关文章推荐
- 使用sqlite3与C接口开发数据库程序
- Ubuntu下sqlite3的配置与使用(以后会说到Ubuntu下C++数据库应用开发程序(窗体程序))
- 使用ADO封装类的数据库程序开发实例
- 使用ADO封装类的数据库程序开发实例(上)
- 使用ADO封装类的数据库程序开发实例[第二版] (上)
- 使用ADO封装类的数据库程序开发实例[第二版] (上zz)
- 关于使用SQL自动生成,程序转化工具,提高开发数据库的效率
- 使用sqlite3与C接口开发数据库程序 - [编程]
- 使用ADO封装类的数据库程序开发实例[第二版] (下)
- 使用ADO封装类的数据库程序开发实例(上)
- 使用ADO封装类的数据库程序开发实例(下)
- 使用ADO封装类的数据库程序开发实例[第二版]
- 使用ADO封装类的数据库程序开发实例[第二版] (上)
- 使用ADO封装类的数据库程序开发实例
- 使用ADO封装类的数据库程序开发实例[第二版] (下)
- 转 成真 使用ADO封装类的数据库程序开发实例[第二版] (上)
- 使用ADO封装类的数据库程序开发实例
- 转 成真 使用ADO封装类的数据库程序开发实例[第二版] (下)
- 使用ADO封装类的数据库程序开发实例(上)
- 使用sqlite3与C接口开发数据库程序