Top Fields Constructors Methods
com.mysql.cj

public Class NativeQueryBindings

extends Object
implements QueryBindings
Class Inheritance
All Implemented Interfaces
com.mysql.cj.QueryBindings
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .InputStream, .ObjectOutputStream, .Reader, java.math.BigDecimal, .BigInteger, java.sql.Blob, .Clob, .Date, .NClob, .Time, .Timestamp, java.time.Duration, .Instant, .LocalDate, .LocalDateTime, .LocalTime, .OffsetDateTime, .OffsetTime, .ZonedDateTime, java.util.Calendar, .HashMap, .Map, .Map.Entry, .Optional, java.util.concurrent.atomic.AtomicBoolean, java.util.function.Function, com.mysql.cj.conf.PropertyKey, com.mysql.cj.exceptions.ExceptionFactory, .MysqlErrorNumbers, .WrongArgumentException, com.mysql.cj.protocol.ColumnDefinition, com.mysql.cj.result.Field, com.mysql.cj.util.StringUtils

Field Summary

Modifier and TypeField and Description
private Function<Session, BindValue>
private BindValue[]
bindValues

Bind values for individual fields

private ColumnDefinition
private static final Map<Class<?>, MysqlType>
private boolean
isLoadDataQuery

Is this query a LOAD DATA query?

private boolean
longParameterSwitchDetected

Flag indicating whether or not the long parameters have been 'switched' back to normal parameters.

private int
private AtomicBoolean
sendTypesToServer

Do we need to send/resend types to the server?

private Session

Constructor Summary

AccessConstructor and Description
public
NativeQueryBindings(int parameterCount, Session sess, Function<Session, BindValue> bindValueConstructor)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public boolean
public QueryBindings
clone()

Overrides java.lang.Object.clone.

Implements com.mysql.cj.QueryBindings.clone.

Creates and returns a copy of this object.

public BindValue

Returns:

BindValue
getBinding
(int
0-based
parameterIndex
,
boolean
is this for a stream?
forLongData
)

Implements com.mysql.cj.QueryBindings.getBinding.

Returns the structure representing the value that (can be)/(is) bound at the given parameter index.

public BindValue[]
public byte[]
public int
public AtomicBoolean
public boolean
public boolean
isNull(int parameterIndex)

Implements com.mysql.cj.QueryBindings.isNull.

public void
setAsciiStream(int parameterIndex, InputStream x, int length)

Implements com.mysql.cj.QueryBindings.setAsciiStream.

public void
public void
public void
setBinaryStream(int parameterIndex, InputStream x, int length)

Implements com.mysql.cj.QueryBindings.setBinaryStream.

public void
public void
setBlob(int parameterIndex, Blob x)

Implements com.mysql.cj.QueryBindings.setBlob.

public void
setBoolean(int parameterIndex, boolean x)

Implements com.mysql.cj.QueryBindings.setBoolean.

public void
setByte(int parameterIndex, byte x)

Implements com.mysql.cj.QueryBindings.setByte.

public void
setBytes(int parameterIndex, byte[] x, boolean escapeIfNeeded)

Implements com.mysql.cj.QueryBindings.setBytes.

public void
setCharacterStream(int parameterIndex, Reader reader, int length)

Implements com.mysql.cj.QueryBindings.setCharacterStream.

public void
setClob(int parameterIndex, Clob x)

Implements com.mysql.cj.QueryBindings.setClob.

public void
public void
setDate(int parameterIndex, Date x, Calendar cal)

Implements com.mysql.cj.QueryBindings.setDate.

public void
setDouble(int parameterIndex, double x)

Implements com.mysql.cj.QueryBindings.setDouble.

public void
setFloat(int parameterIndex, float x)

Implements com.mysql.cj.QueryBindings.setFloat.

public void
public void
setInt(int parameterIndex, int x)

Implements com.mysql.cj.QueryBindings.setInt.

public void
setLong(int parameterIndex, long x)

Implements com.mysql.cj.QueryBindings.setLong.

public void
public void
setNCharacterStream(int parameterIndex, Reader reader, long length)

Implements com.mysql.cj.QueryBindings.setNCharacterStream.

public void
setNClob(int parameterIndex, NClob value)

Implements com.mysql.cj.QueryBindings.setNClob.

public void
setNString(int parameterIndex, String x)

Implements com.mysql.cj.QueryBindings.setNString.

public void
setNull(int parameterIndex)

Implements com.mysql.cj.QueryBindings.setNull.

public void
public void
setObject(int parameterIndex, Object parameterObj)

Implements com.mysql.cj.QueryBindings.setObject.

public void
setObject(int
the first parameter is 1...
parameterIndex
,
Object
the object containing the input parameter value
parameterObj
,
MysqlType
The MysqlType to be send to the database
targetMysqlType
,
int
For Types.DECIMAL or Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored.
scaleOrLength
)

Implements com.mysql.cj.QueryBindings.setObject.

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

protected final void
setSerializableObject(int
parameter index
parameterIndex
,
Object
value
parameterObj
)

Sets the value for the placeholder as a serialized Java object (used by various forms of setObject()

public void
setShort(int parameterIndex, short x)

Implements com.mysql.cj.QueryBindings.setShort.

public void
setString(int parameterIndex, String x)

Implements com.mysql.cj.QueryBindings.setString.

public void
setTime(int parameterIndex, Time x, Calendar cal)

Implements com.mysql.cj.QueryBindings.setTime.

public void
setTimestamp(int parameterIndex, Timestamp x, Calendar targetCalendar, Field field, MysqlType targetMysqlType)

Implements com.mysql.cj.QueryBindings.setTimestamp.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bindValueConstructorback to summary
private Function<Session, BindValue> bindValueConstructor
bindValuesback to summary
private BindValue[] bindValues

Bind values for individual fields

columnDefinitionback to summary
private ColumnDefinition columnDefinition
DEFAULT_MYSQL_TYPESback to summary
private static final Map<Class<?>, MysqlType> DEFAULT_MYSQL_TYPES
isLoadDataQueryback to summary
private boolean isLoadDataQuery

Is this query a LOAD DATA query?

longParameterSwitchDetectedback to summary
private boolean longParameterSwitchDetected

Flag indicating whether or not the long parameters have been 'switched' back to normal parameters. We cannot execute() if clearParameters() has not been called in this case.

numberOfExecutionsback to summary
private int numberOfExecutions
sendTypesToServerback to summary
private AtomicBoolean sendTypesToServer

Do we need to send/resend types to the server?

sessionback to summary
private Session session

Constructor Detail

NativeQueryBindingsback to summary
public NativeQueryBindings(int parameterCount, Session sess, Function<Session, BindValue> bindValueConstructor)

Method Detail

checkAllParametersSetback to summary
public void checkAllParametersSet()

Implements com.mysql.cj.QueryBindings.checkAllParametersSet.

Annotations
@Override
checkParameterSetback to summary
public void checkParameterSet(int columnIndex)

Implements com.mysql.cj.QueryBindings.checkParameterSet.

Annotations
@Override
clearBindValuesback to summary
public boolean clearBindValues()

Implements com.mysql.cj.QueryBindings.clearBindValues.

Returns:boolean

Doc from com.mysql.cj.QueryBindings.clearBindValues.

true if bind values had long data

Annotations
@Override
cloneback to summary
public QueryBindings clone()

Overrides java.lang.Object.clone.

Implements com.mysql.cj.QueryBindings.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:QueryBindings

a clone of this instance.

Annotations
@Override
getBindingback to summary
public BindValue getBinding(int parameterIndex, boolean forLongData)

Implements com.mysql.cj.QueryBindings.getBinding.

Returns the structure representing the value that (can be)/(is) bound at the given parameter index.

Parameters
parameterIndex:int

0-based

forLongData:boolean

is this for a stream?

Returns:BindValue

BindValue

Annotations
@Override
getBindValuesback to summary
public BindValue[] getBindValues()

Implements com.mysql.cj.QueryBindings.getBindValues.

Annotations
@Override
getBytesRepresentationback to summary
public byte[] getBytesRepresentation(int parameterIndex)

Implements com.mysql.cj.QueryBindings.getBytesRepresentation.

Annotations
@Override
getNumberOfExecutionsback to summary
public int getNumberOfExecutions()

Implements com.mysql.cj.QueryBindings.getNumberOfExecutions.

Annotations
@Override
getSendTypesToServerback to summary
public AtomicBoolean getSendTypesToServer()

Implements com.mysql.cj.QueryBindings.getSendTypesToServer.

Annotations
@Override
isLongParameterSwitchDetectedback to summary
public boolean isLongParameterSwitchDetected()

Implements com.mysql.cj.QueryBindings.isLongParameterSwitchDetected.

Annotations
@Override
isNullback to summary
public boolean isNull(int parameterIndex)

Implements com.mysql.cj.QueryBindings.isNull.

Annotations
@Override
setAsciiStreamback to summary
public void setAsciiStream(int parameterIndex, InputStream x, int length)

Implements com.mysql.cj.QueryBindings.setAsciiStream.

Annotations
@Override
setBigDecimalback to summary
public void setBigDecimal(int parameterIndex, BigDecimal x)

Implements com.mysql.cj.QueryBindings.setBigDecimal.

Annotations
@Override
setBigIntegerback to summary
public void setBigInteger(int parameterIndex, BigInteger x)

Implements com.mysql.cj.QueryBindings.setBigInteger.

Annotations
@Override
setBinaryStreamback to summary
public void setBinaryStream(int parameterIndex, InputStream x, int length)

Implements com.mysql.cj.QueryBindings.setBinaryStream.

Annotations
@Override
setBindValuesback to summary
public void setBindValues(BindValue[] bindValues)

Implements com.mysql.cj.QueryBindings.setBindValues.

Annotations
@Override
setBlobback to summary
public void setBlob(int parameterIndex, Blob x)

Implements com.mysql.cj.QueryBindings.setBlob.

Annotations
@Override
setBooleanback to summary
public void setBoolean(int parameterIndex, boolean x)

Implements com.mysql.cj.QueryBindings.setBoolean.

Annotations
@Override
setByteback to summary
public void setByte(int parameterIndex, byte x)

Implements com.mysql.cj.QueryBindings.setByte.

Annotations
@Override
setBytesback to summary
public void setBytes(int parameterIndex, byte[] x, boolean escapeIfNeeded)

Implements com.mysql.cj.QueryBindings.setBytes.

Annotations
@Override
setCharacterStreamback to summary
public void setCharacterStream(int parameterIndex, Reader reader, int length)

Implements com.mysql.cj.QueryBindings.setCharacterStream.

Annotations
@Override
setClobback to summary
public void setClob(int parameterIndex, Clob x)

Implements com.mysql.cj.QueryBindings.setClob.

Annotations
@Override
setColumnDefinitionback to summary
public void setColumnDefinition(ColumnDefinition colDef)

Implements com.mysql.cj.QueryBindings.setColumnDefinition.

Annotations
@Override
setDateback to summary
public void setDate(int parameterIndex, Date x, Calendar cal)

Implements com.mysql.cj.QueryBindings.setDate.

Annotations
@Override
setDoubleback to summary
public void setDouble(int parameterIndex, double x)

Implements com.mysql.cj.QueryBindings.setDouble.

Annotations
@Override
setFloatback to summary
public void setFloat(int parameterIndex, float x)

Implements com.mysql.cj.QueryBindings.setFloat.

Annotations
@Override
setFromBindValueback to summary
public void setFromBindValue(int parameterIndex, BindValue bv)

Implements com.mysql.cj.QueryBindings.setFromBindValue.

Annotations
@Override
setIntback to summary
public void setInt(int parameterIndex, int x)

Implements com.mysql.cj.QueryBindings.setInt.

Annotations
@Override
setLongback to summary
public void setLong(int parameterIndex, long x)

Implements com.mysql.cj.QueryBindings.setLong.

Annotations
@Override
setLongParameterSwitchDetectedback to summary
public void setLongParameterSwitchDetected(boolean longParameterSwitchDetected)

Implements com.mysql.cj.QueryBindings.setLongParameterSwitchDetected.

Annotations
@Override
setNCharacterStreamback to summary
public void setNCharacterStream(int parameterIndex, Reader reader, long length)

Implements com.mysql.cj.QueryBindings.setNCharacterStream.

Annotations
@Override
setNClobback to summary
public void setNClob(int parameterIndex, NClob value)

Implements com.mysql.cj.QueryBindings.setNClob.

Annotations
@Override
setNStringback to summary
public void setNString(int parameterIndex, String x)

Implements com.mysql.cj.QueryBindings.setNString.

Annotations
@Override
setNullback to summary
public void setNull(int parameterIndex)

Implements com.mysql.cj.QueryBindings.setNull.

Annotations
@Override
setNumberOfExecutionsback to summary
public void setNumberOfExecutions(int numberOfExecutions)

Implements com.mysql.cj.QueryBindings.setNumberOfExecutions.

Annotations
@Override
setObjectback to summary
public void setObject(int parameterIndex, Object parameterObj)

Implements com.mysql.cj.QueryBindings.setObject.

Annotations
@Override
setObjectback to summary
public void setObject(int parameterIndex, Object parameterObj, MysqlType targetMysqlType, int scaleOrLength)

Implements com.mysql.cj.QueryBindings.setObject.

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The given Java object will be converted to the targetMysqlType before being sent to the database.

Parameters
parameterIndex:int

the first parameter is 1...

parameterObj:Object

the object containing the input parameter value

targetMysqlType:MysqlType

The MysqlType to be send to the database

scaleOrLength:int

For Types.DECIMAL or Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored.

Annotations
@Override
setSerializableObjectback to summary
protected final void setSerializableObject(int parameterIndex, Object parameterObj)

Sets the value for the placeholder as a serialized Java object (used by various forms of setObject()

Parameters
parameterIndex:int

parameter index

parameterObj:Object

value

setShortback to summary
public void setShort(int parameterIndex, short x)

Implements com.mysql.cj.QueryBindings.setShort.

Annotations
@Override
setStringback to summary
public void setString(int parameterIndex, String x)

Implements com.mysql.cj.QueryBindings.setString.

Annotations
@Override
setTimeback to summary
public void setTime(int parameterIndex, Time x, Calendar cal)

Implements com.mysql.cj.QueryBindings.setTime.

Annotations
@Override
setTimestampback to summary
public void setTimestamp(int parameterIndex, Timestamp x, Calendar targetCalendar, Field field, MysqlType targetMysqlType)

Implements com.mysql.cj.QueryBindings.setTimestamp.

Annotations
@Override