JDBI Guice

Binds JDBI resources into the Guice dependency injection framework.

License

License

MIT License
Categories

Categories

GUI User Interface JDBI Data Databases Guice Application Layer Libs Dependency Injection
GroupId

GroupId

com.github.mlk
ArtifactId

ArtifactId

jdbi-guice
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

JDBI Guice
Binds JDBI resources into the Guice dependency injection framework.
Project URL

Project URL

https://github.com/mlk/jdbi-guice
Source Code Management

Source Code Management

http://github.com/mlk/jdbi-guice

Download jdbi-guice

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mlk/jdbi-guice/ -->
<dependency>
    <groupId>com.github.mlk</groupId>
    <artifactId>jdbi-guice</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mlk/jdbi-guice/
implementation 'com.github.mlk:jdbi-guice:1.0.0'
// https://jarcasting.com/artifacts/com.github.mlk/jdbi-guice/
implementation ("com.github.mlk:jdbi-guice:1.0.0")
'com.github.mlk:jdbi-guice:jar:1.0.0'
<dependency org="com.github.mlk" name="jdbi-guice" rev="1.0.0">
  <artifact name="jdbi-guice" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mlk', module='jdbi-guice', version='1.0.0')
)
libraryDependencies += "com.github.mlk" % "jdbi-guice" % "1.0.0"
[com.github.mlk/jdbi-guice "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.github.mlk : magical-provider-guice jar 1.0.1
org.jdbi : jdbi jar 2.72

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.9.5
com.h2database : h2 jar 1.4.191

Project Modules

There are no modules declared in this project.

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>

Versions

Version
1.0.0