资 源 简 介
SQL Query Builder
SQL Query builder is a Java API that allows us to build a SQL query without need for an ugly string concatenation in the code construct. This API is very helpful to build a query dynamically at run time using easy & simple builder.
INSERT Example
INSERT INTO tableName(col1, col2, col3 ) VALUES (?, ?, ? )
To construct the above query using SQL Query Builder
SqlQueryBuilder qb = new SqlQueryBuilder();qb.insert("tableName", "col1", "col2", "col3");System.out.println("Query :"+qb.toSql());
SELECT Example
1. Simple Select
SELECT col1, col2, col3, col4 FROM tableName
To construct the above query using SQL Query Builder
SqlQueryBuilder qb = new SqlQueryBuilder(); qb.select("col1", "col2", "col3", "col4&qu