Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:47:04+00:00 2026-05-22T21:47:04+00:00

I want to know about the differences between JDBC and JDBI in java. In

  • 0

I want to know about the differences between JDBC and JDBI in java. In particular, which one is generally better and why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:47:05+00:00Added an answer on May 22, 2026 at 9:47 pm

    (I am the primary author of jDBI)

    jDBI is a convenience library built on top of JDBC. JDBC works very well but generally seems to optimize for the database vendors (driver writers) over the users. jDBI attempts to expose the same functionality, but in an API optimized for users.

    It is much lower level than things like Hibernate or JPA. The closest similar library is probably MyBatis (forked successor to iBATIS).

    jDBI supports two style APIs, an older fluent style, which looks like:

    List<Something> r = h.createQuery("select * from something where name = :name and id = :id")
                    .bind(0, "eric")
                    .bind("id", 1)
                    .map(Something.class)
                    .list();
    

    A newer SQL Object API does much more reflective type stuff and really does start to abstract a bunch of JDBC stuff:

    interface TheBasics
    {
        @SqlUpdate("insert into something (id, name) values (:id, :name)")
        int insert(@BindBean Something something);
    
        @SqlQuery("select id, name from something where id = :id")
        Something findById(@Bind("id") long id);
    }
    
    @Test
    public void useTheBasics() throws Exception
    {
        TheBasics dao = dbi.onDemand(TheBasics.class);
    
        dao.insert(new Something(7, "Martin"));
    
        Something martin = dao.findById(7);
    }
    

    The library has good reference docs (javadoc) and some reasonable tutorial style documentation at http://jdbi.org/. It has been around since 2004, and is used by a relatively small number of folks (some few dozen people I know of personally, and maybe a dozen companies) but it works very well for them. Most of the folks who work on it are A+ folks, and are primarily concerned with building a tool that works well for them — that it is open source is largely a side effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know the differences/similarities between Hibernate and simple persistence in Java EE
Did any one know about Renderscript in android 3.0 Also I want to know
ResponseWriter writer=context.getResponseWriter(); I want to know about startElement , endElement , and writeAttribute methods
First of all, I know about the command line parameter, but I don't want
Want to know what the stackoverflow community feels about the various free and non-free
I am not concerned about other kinds of attacks. Just want to know whether
I want to know which tool can be used to measure the cyclomatic complexity
I want to know if i can create a custom google maps application,on which
For now I have a slight idea about the differences between SOAP and RESTful
From MSDN about the differences between Adding or Inserting an item the ASP.NET Cache:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.