dalesbred

Dalesbred - a database access library

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

fi.evident.dalesbred
ArtifactId

ArtifactId

dalesbred
Last Version

Last Version

0.8.0
Release Date

Release Date

Type

Type

jar
Description

Description

dalesbred
Dalesbred - a database access library
Project URL

Project URL

https://dalesbred.evident.fi/
Project Organization

Project Organization

Evident Solutions
Source Code Management

Source Code Management

https://github.com/EvidentSolutions/dalesbred

Download dalesbred

How to add to project

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

Dependencies

compile (8)

Group / Artifact Type Version
org.jetbrains : annotations Optional jar 13.0
org.springframework : spring-context Optional jar 4.0.3.RELEASE
joda-time : joda-time Optional jar 2.3
com.google.inject : guice Optional jar 3.0
org.springframework : spring-jdbc Optional jar 4.0.3.RELEASE
org.threeten : threetenbp Optional jar 1.0
org.postgresql : postgresql Optional jar 9.3-1101-jdbc41
aopalliance : aopalliance Optional jar 1.0

Project Modules

There are no modules declared in this project.

Dalesbred

Dalesbred is a breed of domestic sheep originating in the United Kingdom.

It is also a library that strives to make database access from Java nicer. Dalesbred assumes that SQL is a great way to access database, but that JDBC as an API causes pain. Therefore it wraps JDBC with a set of helpers while still providing access to low-level functionality.

Visit the Dalesbred website for details.

Build Status

Quick-start

Add dependency to your pom.xml:

<dependency>
    <groupId>org.dalesbred</groupId>
    <artifactId>dalesbred</artifactId>
    <version>1.3.3</version>
</dependency>

Create a class with public fields, normal JavaBean accessors or a constructor matching your SQL-query. For example:

public class Department {
    public int id;
    public String name;
}

Create a database connection:

Database db = Database.forUrlAndCredentials("jdbc:example-url", "login", "password");

Fetch matching rows from table:

List<Department> departments = db.findAll(Department.class,
        "select id, name from department where name like ?", "%foo");

Insert a new row:

db.update("insert into user (id, name) values (?, ?)", 42, "Example User");

Improve your experience with Kotlin and bundled extension methods:

val departments = db.findAll<Department>("""
    select id, name 
      from department
      where name like ?""", 
    "%foo")

Documentation

IDEA-integration

If you're using IntelliJ IDEA, check out Dalesbred IDEA Plugin, which provides inspections for common errors (e.g. mismatch between query parameters and query).

fi.evident.dalesbred

Evident Solutions

Passion. Kiwi. Mango.

Versions

Version
0.8.0
0.7.1
0.7.0
0.7.0-rc.2
0.7.0-rc.1
0.6.0
0.6.0-RC1
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.5
0.2.4
0.2.3