GithubHelp home page GithubHelp logo

tianzhizhu / sql2o Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaberg/sql2o

0.0 2.0 0.0 1.61 MB

sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters.

Home Page: http://sql2o.org

License: MIT License

Java 100.00%

sql2o's Introduction

sql2o Build 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 least Java 7 to run

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.

Download oracle driver

To run the oracle database tests it is necessary to download the oracle jdbc driver manually, and register it with maven. Oracle does not have a public repository where maven can download the driver automatically. Note that public repositories do exist, but they are all technically illegal.

  • Download the ojdbc6.jar version 11.2.0.3 from here
  • Install it into your local maven repo by running this command:
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.