java - DataSource for standalone application - no application server

。_饼干妹妹 提交于 2019-11-27 13:50:17
  1. I would advise to use a library like DBPool. It'll take a lot of headaches away from you because the developer already took care of them.
  2. To ensure proper cleanup of your connection pool, read the documentation about a JVM Shutdown hook.

Take a look at Apache Cayenne, in doc read about DataSource and faq about connection pools

EDIT:

As a bonus you get modeler (graphical tool for database) and easy integration with Eclipse.

MrSimpleMind

Take a look at Apache DBCP and DBUtils

DBCP will give you features for connection pool etc.

DBUtils will make jdbc easier for you.

As mentioned DBPool is also one, there is BoneCP and plenty pooling tools out there.

Take a look at some samples:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!