Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lightweight JDBC helper library alternative to Apache Commons DbUtils [closed]

I've just developed my own tiny little JDBC helper library, and I've already realized what a maintenance nightmare it will be.

I'm not looking for a full fledged ORM, like Hibernate, just something light and useful to quickly make JDBC calls passing SQL statements without messing with checked exceptions, closing resources manually, etc...

From your experiencie, can you recommend a nice JDBC helper library?

So far now, I've had a look at Apache Commons DbUtils which seems pretty good. Any other idea?

like image 997
opensas Avatar asked Aug 21 '11 11:08

opensas


People also ask

What is the use of DbUtils in Java?

DbUtils is for developers looking to use JDBC without all the mundane pieces. A Data Access Object (DAO) framework - DbUtils can be used to build a DAO framework though. An object oriented abstraction of general database objects like a Table, Column, or PrimaryKey.

What is JDBC in DBMS?

Java™ database connectivity (JDBC) is the JavaSoft specification of a standard application programming interface (API) that allows Java programs to access database management systems. The JDBC API consists of a set of interfaces and classes written in the Java programming language.


2 Answers

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

  • Spring's JdbcTemplate
  • jOOQ (can be used with SQL strings as well - disclaimer: I work for the vendor)
  • Apache DbUtils (which you've mentioned yourself)
  • JDBI
  • sql2o
  • persism
like image 124
Lukas Eder Avatar answered Oct 01 '22 12:10

Lukas Eder


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.

like image 29
Matt Avatar answered Oct 01 '22 10:10

Matt