The Artima Developer Community
Sponsored Link

Java Buzz Forum
jDBI 1.3.0 Released

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brian McCallister

Posts: 1282
Nickname: frums
Registered: Sep, 2003

Brian McCallister is JustaProgrammer who thinks too much.
jDBI 1.3.0 Released Posted: Apr 26, 2005 3:33 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Brian McCallister.
Original Post: jDBI 1.3.0 Released
Feed Title: Waste of Time
Feed URL: http://kasparov.skife.org/blog/index.rss
Feed Description: A simple waste of time and weblog experiment
Latest Java Buzz Posts
Latest Java Buzz Posts by Brian McCallister
Latest Posts From Waste of Time

Advertisement

Released a minor API change version of jDBI last night. Significant features include:

  1. Global named parameters which may be set on either a DBI or Handle intance. Handles inherit named params from their parent DBI, but names set on the Handle do not percolate back up. This added two methods to public interfaces, so lead to the 1.3.X instead of 1.2.X. Feature request from John Wilson, aka tug.
  2. Exceptions thrown within the Spring integration system are wrapped in Spring's DataAccessException hierarchy. Thomas Risberg did the heavy lifting for this one (and noticed they needed to do it!). This support will improve with minor releases as I refactor to make things play better with the exception translator.

Global params are easy to show examples of:

public void testParamOnBareFirst() throws Exception
{
    handle.getGlobalParameters().put("name", "Robert");
    handle.execute("insert into something (id, name) values (:id, :name)", 
                   new Something(1, "Robert"));

    Map robbie = handle.first("select * from something where name = :name");
    assertNotNull(robbie);
    assertEquals(new Integer("1"), robbie.get("id"));
}

public void testOnDBI() throws Exception
{
    handle.close();
    DBI dbi = new DBI(Tools.CONN_STRING);
    dbi.getGlobalParameters().put("name", "Robert");
    handle = dbi.open();

    handle.execute("insert into something (id, name) values (:id, :name)", 
                   Args.with("id", new Integer(1)));
    Map robbie = handle.first("select * from something where name = :name");
    assertNotNull(robbie);
    assertEquals(new Integer("1"), robbie.get("id"));
}

So have fun with it!

Read: jDBI 1.3.0 Released

Topic: Few interesting links Previous Topic   Next Topic Topic: Cruisecontrol not starting JBoss container

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use