SQL Zone is brought to you in partnership with:

I'm a co-founder and CTO of Teamed.io, custom software development company with a unique management methodology. I'm passionate about software quality and effective project management methods. I write in Java, Ruby and JavaScript. I'm a hands-on developer and an architect of rultor.com and jcabi.com. Yegor has posted 3 posts at DZone. You can read more from them at their website. View Full User Profile

Jcabi fluent wrapper of JDBC

  • submit to reddit

There are a number of open source JDBC wrappers, including Olli, JDBI, and Spring JdbcTemplate. All of them are more complex than such a wrapper should be for simple applications, when you need to do a few primitive manipulations with the database. This is what JdbcSession offers (from jcabi-jdbc): 

String name = new JdbcSession(source)
  .sql("SELECT name FROM user WHERE id = ?")
  .select(new SingleHandler<String>(String.class));    .set(12345)

That's all you need to fetch one value from the database, using SQL. The module is available in Maven Central with these coordinates:


Source code is hosted at github: https://github.com/yegor256/jcabi 

Average: 5 (1 vote)
Published at DZone with permission of its author, Yegor Bugayenko.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)