Class SqlBuilder.PreparedSqlBuilder
java.lang.Object
org.tamilnadujug.SqlBuilder
org.tamilnadujug.SqlBuilder.PreparedSqlBuilder
- Enclosing class:
SqlBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classJDBC Batch Builder.Nested classes/interfaces inherited from class org.tamilnadujug.SqlBuilder
SqlBuilder.Batch, SqlBuilder.CallableSqlBuilder, SqlBuilder.PreparedSqlBuilder -
Method Summary
Modifier and TypeMethodDescriptionaddBatch()Builds JDBC Batch Builder.execute(Connection connection) Executes the SQL operation using the given JDBC connection.protected booleanexists(Connection connection) Checks if Record Exists.param(byte[] value) Adds a byte array parameter to the SQL query.Adds a Boolean parameter to the SQL query.Adds a Double parameter to the SQL query.Adds a Float parameter to the SQL query.Adds a parameter to the SQL query.Adds a Long parameter to the SQL query.Adds an Object parameter to the SQL query.Adds an Object parameter to the SQL query with targetSqlType.Adds a Short parameter to the SQL query.Adds a parameter to the SQL query.param(BigDecimal value) Adds a BigDecimal parameter to the SQL query.Adds a Date parameter to the SQL query.Adds a Time parameter to the SQL query.Adds a Timestamp parameter to the SQL query.Adds a parameter with a null.Adds a parameter with a specific SQL type and type name as `NULL` to the SQL query.queryForList(RowMapper<T> query) Get Result as a List for a Query.<T> Sql<T> queryForOne(RowMapper<T> query) Get Result for a Query.<T> Sql<T> queryGeneratedKeys(RowMapper<T> rowMapper) Get Generated Keys for a Query.queryGeneratedKeysAsList(RowMapper<T> rowMapper) Creates query to get Generated Keys As a List.Methods inherited from class org.tamilnadujug.SqlBuilder
addBatch, getSql, prepareCall, prepareSql, queryForBigDecimal, queryForBoolean, queryForByte, queryForBytes, queryForDate, queryForDouble, queryForExists, queryForFloat, queryForInt, queryForListOfBigDecimal, queryForListOfBoolean, queryForListOfByte, queryForListOfBytes, queryForListOfDate, queryForListOfDouble, queryForListOfFloat, queryForListOfInt, queryForListOfLong, queryForListOfObject, queryForListOfShort, queryForListOfString, queryForListOfTime, queryForListOfTimestamp, queryForListOfURL, queryForLong, queryForObject, queryForShort, queryForString, queryForTime, queryForTimestamp, queryForURL, queryGeneratedKeyForBigDecimal, queryGeneratedKeyForBoolean, queryGeneratedKeyForByte, queryGeneratedKeyForBytes, queryGeneratedKeyForDate, queryGeneratedKeyForDouble, queryGeneratedKeyForFloat, queryGeneratedKeyForInt, queryGeneratedKeyForLong, queryGeneratedKeyForObject, queryGeneratedKeyForShort, queryGeneratedKeyForString, queryGeneratedKeyForTime, queryGeneratedKeyForTimestamp, queryGeneratedKeyForURL, queryGeneratedKeysAsListOfBigDecimal, queryGeneratedKeysAsListOfBoolean, queryGeneratedKeysAsListOfByte, queryGeneratedKeysAsListOfBytes, queryGeneratedKeysAsListOfDate, queryGeneratedKeysAsListOfDouble, queryGeneratedKeysAsListOfFloat, queryGeneratedKeysAsListOfInt, queryGeneratedKeysAsListOfLong, queryGeneratedKeysAsListOfObject, queryGeneratedKeysAsListOfShort, queryGeneratedKeysAsListOfString, queryGeneratedKeysAsListOfTime, queryGeneratedKeysAsListOfTimestamp, queryGeneratedKeysAsListOfURL, sql
-
Method Details
-
execute
Executes the SQL operation using the given JDBC connection.- Specified by:
executein interfaceSql<Integer>- Overrides:
executein classSqlBuilder- Parameters:
connection- JDBC connection to use for execution- Returns:
- result of the SQL operation
- Throws:
SQLException- if an error occurs during execution
-
paramNull
Adds a parameter with a null.- Returns:
- the current SqlBuilder instance, for method chaining
-
paramNull
Adds a parameter with a specific SQL type and type name as `NULL` to the SQL query. This method is used when the SQL parameter should be set to `NULL` for types that require a type name in addition to the SQL type, such as SQL `STRUCT` or `ARRAY`.- Parameters:
sqlType- the SQL type of the parameter, as defined inTypestypeName- the type name of the parameter, used for SQL types that require specific type information- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a parameter to the SQL query. The method allows chaining and is used to bind values to placeholders in the SQL query.- Parameters:
value- the value of the parameter to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Short parameter to the SQL query.- Parameters:
value- the Short value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a parameter to the SQL query. The method allows chaining and is used to bind values to placeholders in the SQL query.- Parameters:
value- the value of the parameter to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Double parameter to the SQL query.- Parameters:
value- the Double value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Boolean parameter to the SQL query.- Parameters:
value- the Boolean value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Long parameter to the SQL query.- Parameters:
value- the Long value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Date parameter to the SQL query.- Parameters:
value- the Date value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Float parameter to the SQL query.- Parameters:
value- the Float value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a byte array parameter to the SQL query.- Parameters:
value- the byte array to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a BigDecimal parameter to the SQL query.- Parameters:
value- the BigDecimal value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Time parameter to the SQL query.- Parameters:
value- the Time value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds a Timestamp parameter to the SQL query.- Parameters:
value- the Timestamp value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds an Object parameter to the SQL query.- Parameters:
value- the Object value to be added- Returns:
- the current SqlBuilder instance, for method chaining
-
param
Adds an Object parameter to the SQL query with targetSqlType.- Parameters:
value- the Object value to be addedtargetSqlType- the targeted SqlType.- Returns:
- the current SqlBuilder instance, for method chaining
-
exists
Checks if Record Exists.- Overrides:
existsin classSqlBuilder- Parameters:
connection-- Returns:
- exists
- Throws:
SQLException
-
queryForOne
Get Result for a Query.- Overrides:
queryForOnein classSqlBuilder- Type Parameters:
T-- Parameters:
query-- Returns:
- result
-
queryForList
Get Result as a List for a Query. Creates a new Query object that can be used to execute a SELECT query and map the result set to list of a specific object type using the provided RowMapper.- Overrides:
queryForListin classSqlBuilder- Type Parameters:
T- the type of object to map the result set to- Parameters:
query- an implementation of RowMapper to map each row of the result set- Returns:
- a new Query instance for execution
-
queryGeneratedKeys
Get Generated Keys for a Query. Creates a new Generated Keys object that can be used to execute a SELECT query and map the result set to a specific object type using the provided RowMapper.- Overrides:
queryGeneratedKeysin classSqlBuilder- Type Parameters:
T- the type of object to map the result set to- Parameters:
rowMapper- an implementation of RowMapper to map each row of the result set- Returns:
- a new Query instance for execution
-
queryGeneratedKeysAsList
Creates query to get Generated Keys As a List.- Overrides:
queryGeneratedKeysAsListin classSqlBuilder- Type Parameters:
T- the type of object to map the result set to- Parameters:
rowMapper- an implementation of RowMapper to map each row of the result set- Returns:
- a new Query instance for execution
-
addBatch
Builds JDBC Batch Builder.- Returns:
- batch
-