0

如果我有一个原始的 servlets 应用程序,将 spring 的 jdbc 模板集成到其中有多难?

我不想处理低级 jdbc 代码,所以我在考虑使用 jdbc 模板。

我不想将 spring 用作 IOC 或任何东西,只是想使用 jdbc 工具来使 db 访问不那么痛苦。

除了必要的罐子之外,它是否有任何依赖关系或假设其他东西已经到位?

我正在使用 tomcat 的 jdbc 池,所以我有一个数据源可以传递给它。

4

1 回答 1

2

It is very simple to add and it does not require you use IOC. If you use maven or ivy, the dependencies are handled for you otherwise it is likely you will need spring-core and possibly spring-beans (i dont know the specifics off the top of my head). Also, if you want transactions, then you will want IOC as the container would create proxy beans that implement the transactional behavior.

于 2013-04-08T15:49:32.080 回答