Module io.helidon.dbclient.jdbc
Package io.helidon.dbclient.jdbc
Class JdbcParametersConfig.BuilderBase<BUILDER extends JdbcParametersConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends JdbcParametersConfig>
java.lang.Object
io.helidon.dbclient.jdbc.JdbcParametersConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER
- type of the builder extending this abstract builderPROTOTYPE
- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,
,PROTOTYPE> Prototype.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
JdbcParametersConfig.Builder
- Enclosing interface:
JdbcParametersConfig
public abstract static class JdbcParametersConfig.BuilderBase<BUILDER extends JdbcParametersConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends JdbcParametersConfig>
extends Object
implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
JdbcParametersConfig
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconfig()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).from
(JdbcParametersConfig prototype) Update this builder from an existing prototype instance.from
(JdbcParametersConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected void
Handles providers and decorators.boolean
Set alljava.time
Date/Time values directly usingPreparedStatement.setObject(int, Object)
.setObjectForJavaTime
(boolean setObjectForJavaTime) Set alljava.time
Date/Time values directly usingPreparedStatement.setObject(int, Object)
.int
String
values with length above this limit will be bound usingPreparedStatement.setCharacterStream(int, java.io.Reader, int)
ifuseStringBinding()
is set totrue
.stringBindingSize
(int stringBindingSize) String
values with length above this limit will be bound usingPreparedStatement.setCharacterStream(int, java.io.Reader, int)
ifuseStringBinding()
is set totrue
.boolean
UsePreparedStatement.setTimestamp(int, java.sql.Timestamp)
to setLocalTime
values whentrue
or usePreparedStatement.setTime(int, java.sql.Time)
whenfalse
.timestampForLocalTime
(boolean timestampForLocalTime) UsePreparedStatement.setTimestamp(int, java.sql.Timestamp)
to setLocalTime
values whentrue
or usePreparedStatement.setTime(int, java.sql.Time)
whenfalse
.toString()
boolean
UsePreparedStatement.setBinaryStream(int, java.io.InputStream, int)
binding forbyte[]
values.useByteArrayBinding
(boolean useByteArrayBinding) UsePreparedStatement.setBinaryStream(int, java.io.InputStream, int)
binding forbyte[]
values.boolean
useNString
(boolean useNString) boolean
UsePreparedStatement.setCharacterStream(int, java.io.Reader, int)
binding forString
values with length abovestringBindingSize()
limit.useStringBinding
(boolean useStringBinding) UsePreparedStatement.setCharacterStream(int, java.io.Reader, int)
binding forString
values with length abovestringBindingSize()
limit.protected void
Validates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
Methods inherited from interface io.helidon.builder.api.Prototype.ConfiguredBuilder
discoverService, discoverServices
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype
- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder
- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfacePrototype.ConfiguredBuilder<BUILDER extends JdbcParametersConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends JdbcParametersConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
useNString
- Parameters:
useNString
- whether NString
conversion is used- Returns:
- updated builder instance
- See Also:
-
useStringBinding
UsePreparedStatement.setCharacterStream(int, java.io.Reader, int)
binding forString
values with length abovestringBindingSize()
limit. Default value istrue
.- Parameters:
useStringBinding
- whether to useCharArrayReader
binding- Returns:
- updated builder instance
- See Also:
-
stringBindingSize
String
values with length above this limit will be bound usingPreparedStatement.setCharacterStream(int, java.io.Reader, int)
ifuseStringBinding()
is set totrue
. Default value is1024
.- Parameters:
stringBindingSize
-String
values length limit forCharArrayReader
binding- Returns:
- updated builder instance
- See Also:
-
useByteArrayBinding
UsePreparedStatement.setBinaryStream(int, java.io.InputStream, int)
binding forbyte[]
values. Default value istrue
.- Parameters:
useByteArrayBinding
- whether to useByteArrayInputStream
binding- Returns:
- updated builder instance
- See Also:
-
timestampForLocalTime
UsePreparedStatement.setTimestamp(int, java.sql.Timestamp)
to setLocalTime
values whentrue
or usePreparedStatement.setTime(int, java.sql.Time)
whenfalse
. Default value istrue
.This option is vendor specific. Most of the databases are fine with
Timestamp
, but for example SQL Server requiresTime
. This option does not apply whensetObjectForJavaTime()
is set totrue
. -
setObjectForJavaTime
Set alljava.time
Date/Time values directly usingPreparedStatement.setObject(int, Object)
. This option shall work fine for recent JDBC drivers. Default value istrue
.- Parameters:
setObjectForJavaTime
- whether to usePreparedStatement.setObject(int, Object)
forjava.time
Date/Time values- Returns:
- updated builder instance
- See Also:
-
useNString
public boolean useNString()- Returns:
- the use n string
-
useStringBinding
public boolean useStringBinding()UsePreparedStatement.setCharacterStream(int, java.io.Reader, int)
binding forString
values with length abovestringBindingSize()
limit. Default value istrue
.- Returns:
- the use string binding
-
stringBindingSize
public int stringBindingSize()String
values with length above this limit will be bound usingPreparedStatement.setCharacterStream(int, java.io.Reader, int)
ifuseStringBinding()
is set totrue
. Default value is1024
.- Returns:
- the string binding size
-
useByteArrayBinding
public boolean useByteArrayBinding()UsePreparedStatement.setBinaryStream(int, java.io.InputStream, int)
binding forbyte[]
values. Default value istrue
.- Returns:
- the use byte array binding
-
timestampForLocalTime
public boolean timestampForLocalTime()UsePreparedStatement.setTimestamp(int, java.sql.Timestamp)
to setLocalTime
values whentrue
or usePreparedStatement.setTime(int, java.sql.Time)
whenfalse
. Default value istrue
.This option is vendor specific. Most of the databases are fine with
Timestamp
, but for example SQL Server requiresTime
. This option does not apply whensetObjectForJavaTime()
is set totrue
.- Returns:
- the timestamp for local time
-
setObjectForJavaTime
public boolean setObjectForJavaTime()Set alljava.time
Date/Time values directly usingPreparedStatement.setObject(int, Object)
. This option shall work fine for recent JDBC drivers. Default value istrue
.- Returns:
- the set object for java time
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-