我正在创建一个必须通过JDBC与不同数据库(Oracle,MSSQL,MySQL ……)一起工作的应用程序.我必须通过JDBC工作,因为我的应用程序调用这些数据库中的存储过程.构建此类应用程序的最佳方法是什么?这有什么框架吗?重要...
![](https://oss.womengda.net/imgfile/2310/1ER05V0c3P-422J.jpg)
我正在创建一个必须通过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.
本文标题为:java – 通过JDBC处理不同数据库方言的模式
![](/xwassets/images/pre.png)
![](/xwassets/images/next.png)
- Spring Cloud Alibaba微服务组件Sentinel实现熔断限流 2023-01-08
- java常见log日志的使用方法解析 2023-02-27
- 解决Mybatis plus实体类属性与表字段不一致的问题 2023-02-19
- mybatis插入数据后如何返回新增数据的id值 2023-01-02
- 教你Java中的Lock锁底层AQS到底是如何实现的 2022-11-16
- java – mysql jdbc不成功回滚 2023-10-31
- springboot项目整合注册功能模块开发实战 2023-07-01
- 【Java】内存中的数组 2023-08-31
- SpringBoot yml配置文件读取方法详解 2023-06-23
- Java枚举学习之定义和基本特性详解 2023-04-16