Apache Commons DbUtils 的轻量级 JDBC 帮助程序库替代品

发布于 2024-11-30 10:10:05 字数 1536 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

笑着哭最痛 2024-12-07 10:10:05

以下是与简单 JDBC 交互时“减轻痛苦”的工具列表:

Here's a list of tools that "ease the pain" when interacting with simple JDBC:

木有鱼丸 2024-12-07 10:10:05

还有 ORMLiteMyBatis 也非常轻量。使用 spring 及其行映射器非常简单,但确实需要您直接处理 JDBC。像上面任何一个这样的东西都会隐藏很多东西,而不是像休眠那样过于复杂。

There's also ORMLite and MyBatis which are pretty lightweight as well. Using spring and it's rowmappers is pretty easy, but does require you to deal directly with the JDBC. Something like either of the above will hide alot of that away from you, while not being as overly complicated as hibernate.

爱要勇敢去追 2024-12-07 10:10:05

https://code.google.com/p/jdbc-helper/

这是我复制的说明其项目页面:
受 Spring Jdbctemplate 和 Commons Dbutils 项目的启发,JdbcHelper 是一个非常小的库,用于帮助开发人员编写常见的 jdbc 操作。 JdbcHelper 非常轻量级。它只有 ~70K 并且没有外部依赖。

https://code.google.com/p/jdbc-helper/

Here is the description I copied from its project page:
Inspired by Spring Jdbctemplate and Commons Dbutils projects, JdbcHelper is a very small library for helping the developers code common jdbc operations. JdbcHelper is very lightweight. It is only ~70K and it has no external dependencies.

贱人配狗天长地久 2024-12-07 10:10:05

Yank,它是一个包装 DBUtils 的超轻量 JDBC 持久层。要使用它,您需要为每个表创建一个 POJO 和一个 DAO 类。您编写自己的 SQL 语句并通过 DBProxy 类执行查询。您不必处理连接、结果集和/或其他低级 JDBC 代码。截至 2.0.0 版,Yank jar 只有 13 KB,并且它仅依赖于 SLF4J、DBUtils 和第 3 方数据库 jar,无论您使用哪种数据库技术。

There is Yank, which is an ultra-light JDBC persistance layer that wraps DBUtils. To use it you create for each table a POJO and a DAO Class. You write your own SQL statements and execute queries through the DBProxy class. You don't have to deal with Connections, ResultSets, and or other low level JDBC code. The Yank jar is only 13 KB as of release 2.0.0, and it depends on only SLF4J, DBUtils, and a 3rd-party database jar, whichever database technology you're using.

深海不蓝 2024-12-07 10:10:05

Spring 框架 (spring- dao) 是你的朋友。如果你正确地编程了你的接口,稍后(如果有必要的话)你可以轻松地切换到更强大的东西,比如 Hibernate。也不要低估 Hibernate: Native SQL为您提供了完整 SQL 的功能,并且您仍然可以从对象映射中受益 - 无论如何您都必须进行编程,除非您只需要执行像 select count(*) from ... 一样简单的查询

Spring Framework (spring-dao) is your friend. If you program your interfaces correctly, later (provided it would be necessary) you can easily switch to something more powerful like Hibernate. Also don't underestimate Hibernate: Native SQL gives you a power of full SQL and still you can benefit from object mapping – something which you will have to program anyway unless you only need to execute the queries as simple as select count(*) from ....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文