All Projects → icuter → jsql

icuter / jsql

Licence: MIT License
Programing like SQL syntax with Java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to jsql

warpdb
DSL-driven RDBMS interface for Java.
Stars: ✭ 73 (+329.41%)
Mutual labels:  jdbc
delta
DDD-centric event-sourcing library for the JVM
Stars: ✭ 15 (-11.76%)
Mutual labels:  jdbc
incubator-linkis
Linkis helps easily connect to various back-end computation/storage engines(Spark, Python, TiDB...), exposes various interfaces(REST, JDBC, Java ...), with multi-tenancy, high performance, and resource control.
Stars: ✭ 2,459 (+14364.71%)
Mutual labels:  jdbc
dalesbred
Dalesbred - a database access library for Java
Stars: ✭ 50 (+194.12%)
Mutual labels:  jdbc
liferay-portal-oracledb-support
Liferay Portal 7 Community Edition Oracle Database Support ** NO LONGER MAINTAINED **. Refer to this repository: https://github.com/amusarra/liferay-portal-database-all-in-one-support
Stars: ✭ 13 (-23.53%)
Mutual labels:  jdbc
php-jdbc-bridge
Service and library to allow a PHP application to interface with a database via JDBC
Stars: ✭ 20 (+17.65%)
Mutual labels:  jdbc
spring-data-jdbc-repository
Spring Data JDBC generic DAO implementation in Java (more up-to-date fork)
Stars: ✭ 123 (+623.53%)
Mutual labels:  jdbc
avro-schema-generator
Library for generating avro schema files (.avsc) based on DB tables structure
Stars: ✭ 38 (+123.53%)
Mutual labels:  jdbc
nimble-orm
一个灵活轻量级的基于Spring jdbcTemplate的ORM
Stars: ✭ 36 (+111.76%)
Mutual labels:  jdbc
rxkotlin-jdbc
Fluent RxJava JDBC extension functions for Kotlin
Stars: ✭ 27 (+58.82%)
Mutual labels:  jdbc
PECI-Java-MAR-2015
Repositorio del curso de Java de Mar 2015
Stars: ✭ 29 (+70.59%)
Mutual labels:  jdbc
baymax
铜板街轻量级JDBC层分库分表框架
Stars: ✭ 45 (+164.71%)
Mutual labels:  jdbc
OpenAM
OpenAM is an open access management solution that includes Authentication, SSO, Authorization, Federation, Entitlements and Web Services Security.
Stars: ✭ 476 (+2700%)
Mutual labels:  jdbc
jnosql.github.io
The JNoSQL is a framework whose has the goal to help Java developers to create Java EE applications with NoSQL, whereby they can make scalable application beyond enjoy the polyglot persistence.
Stars: ✭ 13 (-23.53%)
Mutual labels:  jdbc
jdbdt
JDBDT: Java Database Delta Testing
Stars: ✭ 12 (-29.41%)
Mutual labels:  jdbc
jTDS
jTDS JDBC Driver
Stars: ✭ 67 (+294.12%)
Mutual labels:  jdbc
LPU-Java-2022-1
LPU Java JEE Sessions 2022 Batch 1
Stars: ✭ 30 (+76.47%)
Mutual labels:  jdbc
StackMob-3
A plugin designed for bukkit servers, aiming to reduce the lag that both the server and players experience.
Stars: ✭ 23 (+35.29%)
Mutual labels:  jdbc
oksql
An easy clojure postgres library
Stars: ✭ 69 (+305.88%)
Mutual labels:  jdbc
vok-orm
Mapping rows from a SQL database to POJOs in its simplest form
Stars: ✭ 13 (-23.53%)
Mutual labels:  jdbc

JSQL

License

MIT licensed.

Abstract

Welcome to JSQL. It's a lightweight JDBC DSL framework, JSQL means Just SQL and without ORM configuration. It is a framework which is convenience and easy to use, just like sql syntax that you feel free to write SQL as usual and makes Java SQL development more easier.

If you are a Java developer searching for the jdbc framework satisfy functions as connection pool, super lightweight orm and want to write sql like java code programing, then I suggest you could try to use JSQL framework for jdbc operation.

JSQL for Reasons:

  • No SQL string and keep your code graceful
  • No ORM bean code generation mass your git control
  • Provide ExecutorPool/ConnectionPool for jdbc connection pooling without DBCP dependencies

Requirements

  • JDK6 or higher

Features

  1. Connection/JdbcExecutor pool
  2. SQL syntax like builder
  3. Transaction
  4. Support customizing dialects
  5. Pagination
  6. Jdbc executor for query, update or batch update
  7. Super lightweight ORM
  8. Against SQL inject
  9. Logging ability

Support Databases

  1. Cubrid
  2. SQLite
  3. DB2
  4. Derby (EmbeddedDerby/NetworkDerby)
  5. H2
  6. MariaDB
  7. MySQL
  8. Oracle
  9. PostgreSQL
  10. SQLServer2012(version >= 2012)

Quick Start

Maven dependency

<!-- for jdk1.8+ -->
<dependency>
  <groupId>cn.icuter</groupId>
  <artifactId>jsql</artifactId>
  <version>1.1.2</version>
</dependency>

<!-- for jdk1.6+ -->
<dependency>
  <groupId>cn.icuter</groupId>
  <artifactId>jsql-jdk1.6</artifactId>
  <version>1.1.2</version>
</dependency>

Examples

Auto Commit

JSQLDataSource dataSource = JSQLDataSource.newDataSourceBuilder()
                            .url("jdbcUrl").user("jsql").password("pass").build();
List<Map<String, Object>> list = dataSource.select()
                                           .from("table")
                                           .where().eq("name", "jsql")
                                           .execQuery();
SQL: select * from table where name = ?
Value: [jsql]

Transaction

JSQLDataSource dataSource = JSQLDataSource.newDataSourceBuilder()
                            .url("jdbcUrl").user("jsql").password("pass").build();
dataSource.transaction(tx -> {
    tx.insert("table")
      .values(Cond.eq("col1", "val1"), Cond.eq("col2", 102),Cond.eq("col3", "val3"))
      .execUpdate();
    // if exception thrown will call tx.rollback()
    // tx.commit(); // auto commit if transaction ended
});
SQL: insert into table(col1,col2,col3) values(?,?,?)
VALUE: ["val1", 102, "val3"]

Using standalone Transaction to control commit or rollback operation as your favour

JSQLDataSource dataSource = JSQLDataSource.newDataSourceBuilder()
                            .url("jdbcUrl").user("jsql").password("pass").build();
TransactionDataSource tx = dataSource.transaction();
tx.insert("table")
  .values(Cond.eq("col1", "val1"), Cond.eq("col2", 102),Cond.eq("col3", "val3"))
  .execUpdate();
tx.close(); // auto commit
SQL: insert into table(col1,col2,col3) values(?,?,?)
VALUE: ["val1", 102, "val3"]

NOTE

Above examples are using JSQLDataSource inner Connection pool to execute SQL generated by JSQL.

Documents

Find more documentation here.

  1. DataSource
  2. JDBC Connection Pool
  3. Transaction
  4. SQL Builder
  5. Condition
  6. DB Dialect
  7. ORM
  8. SQL Executor
  9. Logging Customization

Release Notes

1.1.2

performance

  • remove Injection's read lock and add snapshot root node for improvement

features

  • use builder patterns to create JSQLDatasource more easier

others

  • update checkstyle version
  • simplify Test Unit Exception checking with Lamda

1.1.1

bug fixes

  • fix ReentrantLock.lock() prior to try-finally block
  • fix bugs which have been detected by FindBugs tools

performance

  • optimize scheduled task checking and invalidation

1.1.0

bug fixes

  • fix fields injection

performance

  • optimize injection checking
  • avoid inflating schedule tasks

1.0.9

bug fixes

  • fix idle object schedule thread can't shutdown immediately

1.0.8

features

  • support validating field name and table name injection

1.0.7

bug fixes

  • fix NPE while checking idle object

1.0.6

bug fixes

  • fix top-select in SelectBuilder.select

features

  • support transaction in JSQLDataSource
  • support insert... select... syntax
  • support Driver properties when getting Connection from Driver

1.0.4

bug fixes

  • fix pool configuration

features

  • execute builder directly in JSQLDataSource
  • refactor Connection object idle timeout validation

jsql-jdk1.6 missing this version

1.0.3

breaks

  • Remove Builder.union and Builder.unionAll operation

bug fixes

  • fix OracleDialect invalid table alias name format
  • fix DB2Dialect invalid table alias name format

features

  • Add builder as Condition value
  • Add UnionSelectBuilder for union/unionAll operation

jsql-jdk1.6 missing this version

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].