微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java – 通过JDBC处理不同数据库方言的模式

我正在创建一个必须通过JDBC与不同数据库(Oracle,MSsql,MySQL ……)一起工作的应用程序.我必须通过JDBC工作,因为我的应用程序调用这些数据库中的存储过程.

构建此类应用程序的最佳方法是什么?这有什么框架吗?

重要:解决方案必须很好地处理Spring Framework.

我正在考虑Hibernate,因为它是强大的ORM解决方案,它具有对存储过程的构建支持http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#sp_query

请告诉我你目前的选择.

最好的祝福,
马克斯

解决方法:

Hibernate通常是标准选项(也是我选择的选项).我更喜欢使用JPA而不是Hibernate,但如果您需要存储过程,那么这不是一个选项.但关于iBatis的评论

虽然我自己没有iBatis的经验,但似乎iBatis的Spring支持并不差:

Spring Reference,第13.6:iBATIS SQL Maps章:

The iBATIS support in the Spring
Framework much resembles the JDBC
support in that it supports the same
template style programming, and as
with JDBC and other ORM technologies,
the iBATIS support works with Spring’s
exception hierarchy and lets you enjoy
Spring’s IoC features.

Transaction management can be handled
through Spring’s standard facilities.
No special transaction strategies are
necessary for iBATIS, because no
special transactional resource
involved other than a JDBC Connection.
Hence, Spring’s standard JDBC
DataSourceTransactionManager or
JtaTransactionManager are perfectly
sufficient.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐