Package com.mysql.cj
Class AbstractQueryBindings<T extends BindValue>
java.lang.Object
com.mysql.cj.AbstractQueryBindings<T>
- All Implemented Interfaces:
QueryBindings<T>
- Direct Known Subclasses:
ClientPreparedQueryBindings,ServerPreparedQueryBindings
public abstract class AbstractQueryBindings<T extends BindValue> extends java.lang.Object implements QueryBindings<T>
-
Field Summary
Fields Modifier and Type Field Description protected T[]bindValuesBind values for individual fieldsprotected java.lang.StringcharEncodingprotected ColumnDefinitioncolumnDefinitionprotected static java.time.LocalDateDEFAULT_DATEprotected static java.time.LocalTimeDEFAULT_TIMEprotected static byte[]HEX_DIGITSprotected booleanisLoadDataQueryIs this query a LOAD DATA query?protected intnumberOfExecutionsprotected RuntimeProperty<java.lang.Boolean>preserveInstantsprotected RuntimeProperty<java.lang.Boolean>sendFractionalSecondsprotected RuntimeProperty<java.lang.Boolean>sendFractionalSecondsForTimeprotected Sessionsessionprotected RuntimeProperty<java.lang.Boolean>useStreamLengthsInPrepStmts -
Constructor Summary
Constructors Constructor Description AbstractQueryBindings(int parameterCount, Session sess) -
Method Summary
Modifier and Type Method Description voidcheckAllParametersSet()abstract voidcheckParameterSet(int columnIndex)booleanclearBindValues()abstract AbstractQueryBindings<T>clone()T[]getBindValues()byte[]getBytesRepresentation(int parameterIndex)intgetNumberOfExecutions()byte[]getOrigBytes(int parameterIndex)voidhexEscapeBlock(byte[] buf, NativePacketPayload packet, int size)Used to escape binary data with hex for mb charsetsprotected abstract voidinitBindValues(int parameterCount)booleanisLoadDataQuery()booleanisNull(int parameterIndex)voidsetBindValues(T[] bindValues)voidsetColumnDefinition(ColumnDefinition colDef)voidsetLoadDataQuery(boolean isLoadDataQuery)voidsetNumberOfExecutions(int numberOfExecutions)voidsetObject(int parameterIndex, java.lang.Object parameterObj)voidsetObject(int parameterIndex, java.lang.Object parameterObj, MysqlType targetMysqlType)voidsetObject(int parameterIndex, java.lang.Object parameterObj, MysqlType targetMysqlType, int scaleOrLength)Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.voidsetOrigValue(int paramIndex, byte[] val)protected voidsetSerializableObject(int parameterIndex, java.lang.Object parameterObj)Sets the value for the placeholder as a serialized Java object (used by various forms of setObject()voidsetTimestamp(int parameterIndex, java.sql.Timestamp x, MysqlType targetMysqlType)voidsetTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar targetCalendar, int fractionalLength, MysqlType targetMysqlType)voidsetTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal, MysqlType targetMysqlType)voidsetValue(int paramIndex, byte[] val, MysqlType type)voidsetValue(int paramIndex, java.lang.String val, MysqlType type)Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mysql.cj.QueryBindings
bindTimestamp, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigInteger, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setBytes, setBytesNoEscape, setBytesNoEscapeNoQuotes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLocalDate, setLocalDateTime, setLocalTime, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setShort, setString, setTime, setTime
-
Field Details
-
HEX_DIGITS
protected static final byte[] HEX_DIGITS -
DEFAULT_DATE
protected static final java.time.LocalDate DEFAULT_DATE -
DEFAULT_TIME
protected static final java.time.LocalTime DEFAULT_TIME -
session
-
bindValues
Bind values for individual fields -
charEncoding
protected java.lang.String charEncoding -
numberOfExecutions
protected int numberOfExecutions -
useStreamLengthsInPrepStmts
-
preserveInstants
-
sendFractionalSeconds
-
sendFractionalSecondsForTime
-
isLoadDataQuery
protected boolean isLoadDataQueryIs this query a LOAD DATA query? -
columnDefinition
-
-
Constructor Details
-
Method Details
-
initBindValues
protected abstract void initBindValues(int parameterCount) -
clone
- Specified by:
clonein interfaceQueryBindings<T extends BindValue>- Overrides:
clonein classjava.lang.Object
-
setColumnDefinition
- Specified by:
setColumnDefinitionin interfaceQueryBindings<T extends BindValue>
-
isLoadDataQuery
public boolean isLoadDataQuery()- Specified by:
isLoadDataQueryin interfaceQueryBindings<T extends BindValue>
-
setLoadDataQuery
public void setLoadDataQuery(boolean isLoadDataQuery)- Specified by:
setLoadDataQueryin interfaceQueryBindings<T extends BindValue>
-
getBindValues
- Specified by:
getBindValuesin interfaceQueryBindings<T extends BindValue>
-
setBindValues
- Specified by:
setBindValuesin interfaceQueryBindings<T extends BindValue>
-
clearBindValues
public boolean clearBindValues()- Specified by:
clearBindValuesin interfaceQueryBindings<T extends BindValue>- Returns:
- true if bind values had long data
-
checkParameterSet
public abstract void checkParameterSet(int columnIndex)- Specified by:
checkParameterSetin interfaceQueryBindings<T extends BindValue>
-
checkAllParametersSet
public void checkAllParametersSet()- Specified by:
checkAllParametersSetin interfaceQueryBindings<T extends BindValue>
-
getNumberOfExecutions
public int getNumberOfExecutions()- Specified by:
getNumberOfExecutionsin interfaceQueryBindings<T extends BindValue>
-
setNumberOfExecutions
public void setNumberOfExecutions(int numberOfExecutions)- Specified by:
setNumberOfExecutionsin interfaceQueryBindings<T extends BindValue>
-
setValue
- Specified by:
setValuein interfaceQueryBindings<T extends BindValue>
-
setOrigValue
public final void setOrigValue(int paramIndex, byte[] val) -
getOrigBytes
public byte[] getOrigBytes(int parameterIndex)- Specified by:
getOrigBytesin interfaceQueryBindings<T extends BindValue>
-
setValue
- Specified by:
setValuein interfaceQueryBindings<T extends BindValue>
-
hexEscapeBlock
Used to escape binary data with hex for mb charsets- Parameters:
buf- source bytespacket- write to this packetsize- number of bytes to read
-
setTimestamp
- Specified by:
setTimestampin interfaceQueryBindings<T extends BindValue>
-
setTimestamp
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal, MysqlType targetMysqlType)- Specified by:
setTimestampin interfaceQueryBindings<T extends BindValue>
-
setTimestamp
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar targetCalendar, int fractionalLength, MysqlType targetMysqlType)- Specified by:
setTimestampin interfaceQueryBindings<T extends BindValue>
-
setObject
public void setObject(int parameterIndex, java.lang.Object parameterObj)- Specified by:
setObjectin interfaceQueryBindings<T extends BindValue>
-
setObject
public void setObject(int parameterIndex, java.lang.Object parameterObj, MysqlType targetMysqlType)- Specified by:
setObjectin interfaceQueryBindings<T extends BindValue>
-
setObject
public void setObject(int parameterIndex, java.lang.Object parameterObj, MysqlType targetMysqlType, int scaleOrLength)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.
- Specified by:
setObjectin interfaceQueryBindings<T extends BindValue>- Parameters:
parameterIndex- the first parameter is 1...parameterObj- the object containing the input parameter valuetargetMysqlType- The MysqlType to be send to the databasescaleOrLength- 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.
-
setSerializableObject
protected final void setSerializableObject(int parameterIndex, java.lang.Object parameterObj)Sets the value for the placeholder as a serialized Java object (used by various forms of setObject()- Parameters:
parameterIndex- parameter indexparameterObj- value
-
isNull
public boolean isNull(int parameterIndex)- Specified by:
isNullin interfaceQueryBindings<T extends BindValue>
-
getBytesRepresentation
public byte[] getBytesRepresentation(int parameterIndex)- Specified by:
getBytesRepresentationin interfaceQueryBindings<T extends BindValue>
-