Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Jcabi fluent wrapper of JDBC

DZone's Guide to

Jcabi fluent wrapper of JDBC

·
Free Resource

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:

<dependency>
  <groupId>com.jcabi</groupId>
  <artifactId>jcabi-jdbc</artifactId>
  <version>0.1.8</version>
</dependency> 

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

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}