Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Build Status codecov.io

jdbi-guice

A module to marry together JDBI bound resources to the Guice dependency injection framework.

Injector injector = Guice.createInjector(JdbiModule.builder().scan("com.github.mlk.guice.dao").build(),
                new AbstractModule() {
                    @Override
                    protected void configure() {
                        bind(DBI.class).toInstance(new DBI("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"));
                    }
                });
        MyDAO myDAO = injector.getInstance(MyDAO.class);

        myDAO.createSomethingTable();
        myDAO.insert(1, "fred");
        System.out.println(myDAO.findNameById(1));

It is on Maven, so use it with:

<dependency>
  <groupId>com.github.mlk</groupId>
  <artifactId>jdbi-guice</artifactId>
  <version>1.0.0</version>
</dependency>

About

A module to marry together JDBI bound resources to the Guice dependency injection framework.

Topics

Resources

License

Packages

No packages published

Languages