Package | Description |
---|---|
org.ujorm.tools.jdbc | |
org.ujorm.tools.sql |
Modifier and Type | Method and Description |
---|---|
JdbcBuilder |
JdbcBuilder.addArguments(Object... values)
Add argument values with no SAPARATOR and no MARKER (for a common use)
|
protected JdbcBuilder |
JdbcBuilder.addValue(Object value)
Add a value to SQL (inlucing MARKER)
|
JdbcBuilder |
JdbcBuilder.andCondition(CharSequence sqlCondition,
String operator,
Object... values)
Add a condition for a multivalue argument joined by AND operator
|
JdbcBuilder |
JdbcBuilder.andCondition(CharSequence sqlCondition,
String operator,
Object value)
Add a condition for a valid argument joined by AND operator
|
JdbcBuilder |
JdbcBuilder.column(CharSequence column)
Add new column
|
JdbcBuilder |
JdbcBuilder.columnInsert(CharSequence column,
Object value)
Set new value to column by template {@code name = ?
|
JdbcBuilder |
JdbcBuilder.columnUpdate(CharSequence column,
Object value)
Set new value to column by template {@code name = ?
|
JdbcBuilder |
JdbcBuilder.condition(CharSequence sqlCondition,
String operator,
Object value)
Add a condition for an argument with length
|
JdbcBuilder |
JdbcBuilder.orCondition(CharSequence sqlCondition,
String operator,
Object... values)
Add a condition for a multivalue argument joined by OR operator
|
JdbcBuilder |
JdbcBuilder.orCondition(CharSequence sqlCondition,
String operator,
Object value)
Add a condition for a valid argument joined by OR operator
|
JdbcBuilder |
JdbcBuilder.value(Object value)
Add an argument value (including a SEPARATOR and a MARKER) for buidling a SQL INSERT statement
|
JdbcBuilder |
JdbcBuilder.write(CharSequence sqlFragment)
Write a sql fragment including a space before
|
JdbcBuilder |
JdbcBuilder.write(JdbcBuilder builder)
Add a another statement to the end of this statement.
|
JdbcBuilder |
JdbcBuilder.writeMany(CharSequence... sqlFragments)
Write many sql fragments including a space before
|
JdbcBuilder |
JdbcBuilder.writeManyNoSpace(CharSequence... sqlFragments)
Write many sql fragments with no space before
|
JdbcBuilder |
JdbcBuilder.writeNoSpace(CharSequence sqlFragment)
Write a sql fragment with no space before
|
Modifier and Type | Method and Description |
---|---|
JdbcBuilder |
JdbcBuilder.write(JdbcBuilder builder)
Add a another statement to the end of this statement.
|
Modifier and Type | Class and Description |
---|---|
class |
SqlBuilder
PrepareStatement builder support
How to use a SELECT
SqlBuilder sql = new SqlBuilder() .select("t.id", "t.name") .from("testTable t") .where() .andCondition("t.name", "=", "Test") .andCondition("t.created", ">=", someDate); for (ResultSet rs : sql.executeSelect(dbConnection)) { int id = rs.getInt(1); String name = rs.getString(2); } How to use a INSERTSqlBuilder sql = new SqlBuilder() .insert("testTable") .write("(") .columnInsert("id", 10) .columnInsert("name", "Test") .columnInsert("date", someDate) .super.write(")"); sql.executeUpdate(dbConnection); How to use a UPDATESqlBuilder sql = new SqlBuilder() .update("testTable") .columnUpdate("name", "Test") .columnUpdate("date", SOME_DATE) .where() .andCondition("id", "IN", 10, 20, 30) .andCondition("created BETWEEN ? |
Copyright 2019-2022, Pavel Ponec