Popularity
5.9
Growing
Activity
2.5
Declining
921
58
205

Code Quality Rank: L1
Programming language: Java
Tags: Database    
Latest version: v1.6.0

sql2o alternatives and similar libraries

Based on the "Database" category

Do you think we are missing an alternative of sql2o or a related project?

Add another 'Database' Library

README

sql2o Build Status Maven Central Coverage Status

Sql2o is a small java library, with the purpose of making database interaction easy. When fetching data from the database, the ResultSet will automatically be filled into your POJO objects. Kind of like an ORM, but without the SQL generation capabilities. Sql2o requires at Java 7 or 8 to run. Java versions past 8 may work, but is currently not supported.

Examples

Check out the sql2o website for examples.

Performance

A key feature of sql2o is performance. The following metrics were based off the Dapper.NET metrics. Note that typical usage can differ from optimal usage for many frameworks. Depending on the framework, typical usage may not involve writing any SQL, or it may map underscore case to camel case, etc.

Performance of SELECT

Execute 1000 SELECT statements against a DB and map the data returned to a POJO. Code is available here.

Method Duration
Hand coded ResultSet 60ms
Sql2o 75ms (25% slower)
Apache DbUtils 98ms (63% slower)
JDBI 197ms (228% slower)
MyBatis 293ms (388% slower)
jOOQ 447ms (645% slower)
Hibernate 494ms (723% slower)
Spring JdbcTemplate 636ms (960% slower)

Contributing

Want to contribute? Awesome! Here's how to set up.

Coding guidelines.

When hacking sql2o, please follow these coding guidelines.

Note on running Oracle specific tests

In order to run the Oracle database tests you will have to add the Oracle Maven repo to your settings.xml as instructed in the Oracle Fusion Middleware Maven Setup guide