Interface | Description |
---|---|
JdbcFunction<R> |
A functional interface
|
RsConsumer |
A ResultSet consumer for usage in the method
Stream.forEach() |
Class | Description |
---|---|
JdbcBuilder |
PrepareStatement builder support
How to use a SELECT
JdbcBuilder sql = new JdbcBuilder() .write("SELECT") .column("t.id") .column("t.name") .write("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 INSERTJdbcBuilder sql = new JdbcBuilder() .write("INSERT INTO testTable (") .columnInsert("id", 10) .columnInsert("name", "Test") .columnInsert("date", someDate) .write(")"); sql.executeUpdate(dbConnection); How to use a UPDATEJdbcBuilder sql = new JdbcBuilder() .write("UPDATE testTable SET") .columnUpdate("name", "Test") .columnUpdate("date", SOME_DATE) .write("WHERE") .andCondition("id", "IN", 10, 20, 30) .andCondition("created BETWEEN ? |
JdbcBuilder.MarkerEnvelope |
A value marker envelope
|
JdbcBuilder.SqlEnvelope |
A SQL fragment
|
ProxySequence |
A proxy CharSequence implementation
|
RowIterator |
An Iterator for the ResultSet items.
|
Copyright 2019-2022, Pavel Ponec