类 NativeProtocol
- java.lang.Object
-
- com.mysql.cj.protocol.AbstractProtocol<NativePacketPayload>
-
- com.mysql.cj.protocol.a.NativeProtocol
-
- 所有已实现的接口:
RuntimeProperty.RuntimePropertyListener,Protocol<NativePacketPayload>,Protocol.ProtocolEventHandler
public class NativeProtocol extends AbstractProtocol<NativePacketPayload> implements Protocol<NativePacketPayload>, RuntimeProperty.RuntimePropertyListener
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.mysql.cj.protocol.Protocol
Protocol.ProtocolEventHandler, Protocol.ProtocolEventListener
-
-
字段概要
-
从类继承的字段 com.mysql.cj.protocol.AbstractProtocol
authProvider, exceptionInterceptor, log, messageBuilder, packetDebugRingBuffer, propertySet, queryTimingUnits, session, socketConnection, transactionManager, useNanosForElapsedTime
-
-
构造器概要
构造器 构造器 说明 NativeProtocol(Log logger)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterHandshake()voidapplyPacketDecorators(MessageSender<NativePacketPayload> sender, MessageReader<NativePacketHeader,NativePacketPayload> messageReader)Apply optional decorators to configured PacketSender and PacketReader.voidbeforeHandshake()voidchangeDatabase(String database)voidchangeUser(String user, String password, String database)Re-authenticates as the given user and passwordNativePacketPayloadcheckErrorMessage()Read one message from the MySQL server, checks for errors in it, and if none, returns the message, ready for readingvoidcheckErrorMessage(NativePacketPayload resultPacket)voidcheckForOutstandingStreamingData()voidcheckTransactionState()voidclearInputStream()voidclose()voidconfigureTimeZone()Configures the client's timezone if required.voidconnect(String user, String password, String database)Create a new session.SQLWarningconvertShowWarningsToSQLWarnings(boolean forTruncationOnly)Turns output of 'SHOW WARNINGS' into JDBC SQLWarning instances.voiddumpPacketRingBuffer()voidexplainSlowQuery(String query, String truncatedQuery)Runs an 'EXPLAIN' on the given query and dumps the results to the logstatic MysqlTypefindMysqlType(PropertySet propertySet, int mysqlTypeId, short colFlag, long length, LazyString tableName, LazyString originalTableName, int collationIndex, String encoding)StringBuildergenerateQueryCommentBlock(StringBuilder buf)intgetCommandCount()longgetCurrentTimeNanosOrMillis()static NativeProtocolgetInstance(Session session, SocketConnection socketConnection, PropertySet propertySet, Log log, TransactionEventHandler transactionManager)InputStreamgetLocalInfileInputStream()Returns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement.MessageBuilder<NativePacketPayload>getMessageBuilder()BaseMetricsHoldergetMetricsHolder()MessageReader<NativePacketHeader,NativePacketPayload>getPacketReader()MessageSender<NativePacketPayload>getPacketSender()StringgetQueryComment()Returns the comment that will be prepended to all statements sent to the server.List<QueryInterceptor>getQueryInterceptors()NativePacketPayloadgetReusablePacket()NativeServerSessiongetServerSession()NativePacketPayloadgetSharedSendPacket()Returns the packet used for sending data (used by PreparedStatement) with position set to 0.longgetSlowQueryThreshold()ResultsetRowsgetStreamingData()java.util.function.Supplier<ValueEncoder>getValueEncoderSupplier(Object obj)intgetWarningCount()booleanhadWarnings()voidhandlePropertyChange(RuntimeProperty<?> prop)voidinit(Session sess, SocketConnection phConnection, PropertySet propSet, TransactionEventHandler trManager)Init method takes the place of constructor.voidinitServerSession()<T extends Resultset>
TinvokeQueryInterceptorsPost(java.util.function.Supplier<String> sql, Query interceptedQuery, T originalResultSet, boolean forceExecute)<M extends Message>
MinvokeQueryInterceptorsPost(M queryPacket, M originalResponsePacket, boolean forceExecute)<T extends Resultset>
TinvokeQueryInterceptorsPre(java.util.function.Supplier<String> sql, Query interceptedQuery, boolean forceExecute)<M extends Message>
MinvokeQueryInterceptorsPre(M queryPacket, boolean forceExecute)protected booleanisDataAvailable()voidnegotiateSSLConnection()Negotiates the SSL communications channel used when connecting to a MySQL server that understands SSL.NativePacketPayloadprobeMessage(NativePacketPayload reuse)voidquit()Log-off of the MySQL server and close the socket.<T extends ProtocolEntity>
Tread(Class<Resultset> requiredClass, int maxRows, boolean streamResults, NativePacketPayload resultPacket, boolean isBinaryEncoded, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> protocolEntityFactory)Read protocol entity.<T extends ProtocolEntity>
Tread(Class<T> requiredClass, ProtocolEntityFactory<T,NativePacketPayload> protocolEntityFactory)<T extends Resultset>
TreadAllResults(int maxRows, boolean streamResults, NativePacketPayload resultPacket, boolean isBinaryEncoded, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)NativePacketPayloadreadMessage(NativePacketPayload reuse)Read one message from the MySQL server into the reusable buffer if provided or into the new one.ColumnDefinitionreadMetadata()<T extends ProtocolEntity>
TreadNextResultset(T currentProtocolEntity, int maxRows, boolean streamResults, boolean isBinaryEncoded, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)Read next result set from multi-result chain.<T extends QueryResult>
TreadQueryResult(ResultBuilder<T> resultBuilder)Read messages from server and deliver them to resultBuilder.NativeCapabilitiesreadServerCapabilities()Retrieve ServerCapabilities from server.<T> TreadServerStatusForResultSets(NativePacketPayload rowPacket, boolean saveOldStatus)voidreclaimLargeReusablePacket()Don't hold on to overly-large packetsvoidrejectProtocol(NativePacketPayload msg)voidreleaseResources()voidscanForAndThrowDataTruncation()voidsend(Message packet, int packetLen)NativePacketPayloadsendCommand(Message queryPacket, boolean skipCheck, int timeoutMillis)Send a command to the MySQL server.NativePacketPayloadsendFileToServer(String fileName)Reads and sends a file to the server for LOAD DATA LOCAL INFILE<T extends Resultset>
TsendQueryPacket(Query callingQuery, NativePacketPayload queryPacket, int maxRows, boolean streamResults, ColumnDefinition cachedMetadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)Send a query stored in a packet to the server.<T extends Resultset>
TsendQueryString(Query callingQuery, String query, String characterEncoding, int maxRows, boolean streamResults, ColumnDefinition cachedMetadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)Build a query packet from the given string and send it to the server.voidsetHadWarnings(boolean hadWarnings)voidsetLocalInfileInputStream(InputStream stream)Sets an InputStream instance that will be used to send data to the MySQL server for a "LOAD DATA LOCAL INFILE" statement rather than a FileInputStream or URLInputStream that represents the path given as an argument to the statement.voidsetQueryComment(String comment)Sets the comment that will be prepended to all statements sent to the server.voidsetQueryInterceptors(List<QueryInterceptor> queryInterceptors)voidsetSocketTimeout(int milliseconds)voidsetStreamingData(ResultsetRows streamingData)voidsetWarningCount(int warningCount)voidskipPacket()Reads and discards a single MySQL packet from the input stream.voidunsetStreamingData(ResultsetRows streamer)protected booleanuseNanosForElapsedTime()booleanversionMeetsMinimum(int major, int minor, int subminor)-
从类继承的方法 com.mysql.cj.protocol.AbstractProtocol
addListener, getAuthenticationProvider, getExceptionInterceptor, getPacketReceivedTimeHolder, getPacketSentTimeHolder, getPropertySet, getQueryTimingUnits, getSocketConnection, invokeListeners, removeListener, reset, setPacketReceivedTimeHolder, setPacketSentTimeHolder, setPropertySet
-
-
-
-
字段详细资料
-
INITIAL_PACKET_SIZE
protected static final int INITIAL_PACKET_SIZE
- 另请参阅:
- 常量字段值
-
COMP_HEADER_LENGTH
protected static final int COMP_HEADER_LENGTH
- 另请参阅:
- 常量字段值
-
MAX_QUERY_SIZE_TO_EXPLAIN
protected static final int MAX_QUERY_SIZE_TO_EXPLAIN
- 另请参阅:
- 常量字段值
-
SSL_REQUEST_LENGTH
protected static final int SSL_REQUEST_LENGTH
- 另请参阅:
- 常量字段值
-
packetSender
protected MessageSender<NativePacketPayload> packetSender
-
packetReader
protected MessageReader<NativePacketHeader,NativePacketPayload> packetReader
-
serverSession
protected NativeServerSession serverSession
-
compressedPacketSender
protected CompressedPacketSender compressedPacketSender
Track this to manually shut down.
-
sharedSendPacket
protected NativePacketPayload sharedSendPacket
-
reusablePacket
protected NativePacketPayload reusablePacket
Use this when reading in rows to avoid thousands of new() calls, because the byte arrays just get copied out of the packet anyway
-
packetSequence
protected byte packetSequence
-
useCompression
protected boolean useCompression
-
hadWarnings
protected boolean hadWarnings
-
PROTOCOL_ENTITY_CLASS_TO_TEXT_READER
protected Map<Class<? extends ProtocolEntity>,ProtocolEntityReader<? extends ProtocolEntity,? extends Message>> PROTOCOL_ENTITY_CLASS_TO_TEXT_READER
-
PROTOCOL_ENTITY_CLASS_TO_BINARY_READER
protected Map<Class<? extends ProtocolEntity>,ProtocolEntityReader<? extends ProtocolEntity,? extends Message>> PROTOCOL_ENTITY_CLASS_TO_BINARY_READER
-
-
构造器详细资料
-
NativeProtocol
public NativeProtocol(Log logger)
-
-
方法详细资料
-
getInstance
public static NativeProtocol getInstance(Session session, SocketConnection socketConnection, PropertySet propertySet, Log log, TransactionEventHandler transactionManager)
-
init
public void init(Session sess, SocketConnection phConnection, PropertySet propSet, TransactionEventHandler trManager)
从接口复制的说明:ProtocolInit method takes the place of constructor. A constructor should be used unless the encapsulation of ProtocolFactory is necessary.- 指定者:
init在接口中Protocol<NativePacketPayload>- 覆盖:
init在类中AbstractProtocol<NativePacketPayload>- 参数:
sess-SessionphConnection-SocketConnectionpropSet-PropertySettrManager-TransactionEventHandler
-
getMessageBuilder
public MessageBuilder<NativePacketPayload> getMessageBuilder()
- 指定者:
getMessageBuilder在接口中Protocol<NativePacketPayload>- 覆盖:
getMessageBuilder在类中AbstractProtocol<NativePacketPayload>
-
getPacketSender
public MessageSender<NativePacketPayload> getPacketSender()
-
getPacketReader
public MessageReader<NativePacketHeader,NativePacketPayload> getPacketReader()
-
getValueEncoderSupplier
public java.util.function.Supplier<ValueEncoder> getValueEncoderSupplier(Object obj)
- 指定者:
getValueEncoderSupplier在接口中Protocol<NativePacketPayload>
-
negotiateSSLConnection
public void negotiateSSLConnection()
Negotiates the SSL communications channel used when connecting to a MySQL server that understands SSL.- 指定者:
negotiateSSLConnection在接口中Protocol<NativePacketPayload>
-
rejectProtocol
public void rejectProtocol(NativePacketPayload msg)
-
beforeHandshake
public void beforeHandshake()
- 指定者:
beforeHandshake在接口中Protocol<NativePacketPayload>
-
afterHandshake
public void afterHandshake()
- 指定者:
afterHandshake在接口中Protocol<NativePacketPayload>
-
handlePropertyChange
public void handlePropertyChange(RuntimeProperty<?> prop)
-
applyPacketDecorators
public void applyPacketDecorators(MessageSender<NativePacketPayload> sender, MessageReader<NativePacketHeader,NativePacketPayload> messageReader)
Apply optional decorators to configured PacketSender and PacketReader.- 参数:
sender-MessageSendermessageReader-MessageReader
-
readServerCapabilities
public NativeCapabilities readServerCapabilities()
从接口复制的说明:ProtocolRetrieve ServerCapabilities from server.- 指定者:
readServerCapabilities在接口中Protocol<NativePacketPayload>- 返回:
ServerCapabilities
-
getServerSession
public NativeServerSession getServerSession()
- 指定者:
getServerSession在接口中Protocol<NativePacketPayload>
-
changeDatabase
public void changeDatabase(String database)
- 指定者:
changeDatabase在接口中Protocol<NativePacketPayload>
-
readMessage
public final NativePacketPayload readMessage(NativePacketPayload reuse)
从接口复制的说明:ProtocolRead one message from the MySQL server into the reusable buffer if provided or into the new one.- 指定者:
readMessage在接口中Protocol<NativePacketPayload>- 参数:
reuse-Messageinstance to read into, may be null- 返回:
- the message from the server.
-
probeMessage
public final NativePacketPayload probeMessage(NativePacketPayload reuse)
-
send
public final void send(Message packet, int packetLen)
- 指定者:
send在接口中Protocol<NativePacketPayload>- 参数:
packet-MessagepacketLen- length of header + payload
-
sendCommand
public final NativePacketPayload sendCommand(Message queryPacket, boolean skipCheck, int timeoutMillis)
从接口复制的说明:ProtocolSend a command to the MySQL server.- 指定者:
sendCommand在接口中Protocol<NativePacketPayload>- 参数:
queryPacket- a packet pre-loaded with data for the protocol (eg. from a client-side prepared statement). The first byte of this packet is the MySQL protocol 'command' from MysqlDefsskipCheck- do not call checkErrorPacket() if truetimeoutMillis- timeout- 返回:
- the response packet from the server
-
checkTransactionState
public void checkTransactionState()
-
checkErrorMessage
public NativePacketPayload checkErrorMessage()
从接口复制的说明:ProtocolRead one message from the MySQL server, checks for errors in it, and if none, returns the message, ready for reading- 指定者:
checkErrorMessage在接口中Protocol<NativePacketPayload>- 返回:
- a message ready for reading.
-
checkErrorMessage
public void checkErrorMessage(NativePacketPayload resultPacket)
-
clearInputStream
public void clearInputStream()
-
reclaimLargeReusablePacket
public void reclaimLargeReusablePacket()
Don't hold on to overly-large packets
-
sendQueryString
public final <T extends Resultset> T sendQueryString(Query callingQuery, String query, String characterEncoding, int maxRows, boolean streamResults, ColumnDefinition cachedMetadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory) throws IOException
Build a query packet from the given string and send it to the server.- 类型参数:
T- extendsResultset- 参数:
callingQuery-Queryquery- query stringcharacterEncoding- Java encoding namemaxRows- rows limitstreamResults- whether a stream result should be createdcachedMetadata- use this metadata instead of the one provided on wireresultSetFactory-ProtocolEntityFactory- 返回:
- T instance
- 抛出:
IOException- if an i/o error occurs
-
sendQueryPacket
public final <T extends Resultset> T sendQueryPacket(Query callingQuery, NativePacketPayload queryPacket, int maxRows, boolean streamResults, ColumnDefinition cachedMetadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory) throws IOException
Send a query stored in a packet to the server.- 类型参数:
T- extendsResultset- 参数:
callingQuery-QueryqueryPacket-NativePacketPayloadcontaining querymaxRows- rows limitstreamResults- whether a stream result should be createdcachedMetadata- use this metadata instead of the one provided on wireresultSetFactory-ProtocolEntityFactory- 返回:
- T instance
- 抛出:
IOException- if an i/o error occurs
-
invokeQueryInterceptorsPre
public <T extends Resultset> T invokeQueryInterceptorsPre(java.util.function.Supplier<String> sql, Query interceptedQuery, boolean forceExecute)
-
invokeQueryInterceptorsPre
public <M extends Message> M invokeQueryInterceptorsPre(M queryPacket, boolean forceExecute)
- 类型参数:
M- extendsMessage- 参数:
queryPacket-NativePacketPayloadcontaining queryforceExecute- currently ignored- 返回:
- M instance
-
invokeQueryInterceptorsPost
public <T extends Resultset> T invokeQueryInterceptorsPost(java.util.function.Supplier<String> sql, Query interceptedQuery, T originalResultSet, boolean forceExecute)
-
invokeQueryInterceptorsPost
public <M extends Message> M invokeQueryInterceptorsPost(M queryPacket, M originalResponsePacket, boolean forceExecute)
- 类型参数:
M- extendsMessage- 参数:
queryPacket-NativePacketPayloadcontaining queryoriginalResponsePacket-NativePacketPayloadcontaining responseforceExecute- currently ignored- 返回:
- T instance
-
getCurrentTimeNanosOrMillis
public long getCurrentTimeNanosOrMillis()
-
hadWarnings
public boolean hadWarnings()
-
setHadWarnings
public void setHadWarnings(boolean hadWarnings)
-
explainSlowQuery
public void explainSlowQuery(String query, String truncatedQuery)
Runs an 'EXPLAIN' on the given query and dumps the results to the log- 参数:
query- full query stringtruncatedQuery- query string truncated for profiling
-
skipPacket
public final void skipPacket()
Reads and discards a single MySQL packet from the input stream.- 抛出:
CJException- if the network fails while skipping the packet.
-
quit
public final void quit()
Log-off of the MySQL server and close the socket.
-
getSharedSendPacket
public NativePacketPayload getSharedSendPacket()
Returns the packet used for sending data (used by PreparedStatement) with position set to 0. Guarded by external synchronization on a mutex.- 返回:
- A packet to send data with
-
changeUser
public void changeUser(String user, String password, String database)
Re-authenticates as the given user and password- 指定者:
changeUser在接口中Protocol<NativePacketPayload>- 参数:
user- user namepassword- passworddatabase- database name
-
useNanosForElapsedTime
protected boolean useNanosForElapsedTime()
-
getSlowQueryThreshold
public long getSlowQueryThreshold()
-
getCommandCount
public int getCommandCount()
-
setQueryInterceptors
public void setQueryInterceptors(List<QueryInterceptor> queryInterceptors)
-
getQueryInterceptors
public List<QueryInterceptor> getQueryInterceptors()
-
setSocketTimeout
public void setSocketTimeout(int milliseconds)
-
releaseResources
public void releaseResources()
-
connect
public void connect(String user, String password, String database)
从接口复制的说明:ProtocolCreate a new session. This generally happens once at the beginning of a connection.- 指定者:
connect在接口中Protocol<NativePacketPayload>- 参数:
user- DB user namepassword- DB user passworddatabase- database name
-
isDataAvailable
protected boolean isDataAvailable()
-
getReusablePacket
public NativePacketPayload getReusablePacket()
-
getWarningCount
public int getWarningCount()
-
setWarningCount
public void setWarningCount(int warningCount)
-
dumpPacketRingBuffer
public void dumpPacketRingBuffer()
-
versionMeetsMinimum
public boolean versionMeetsMinimum(int major, int minor, int subminor)- 指定者:
versionMeetsMinimum在接口中Protocol<NativePacketPayload>
-
findMysqlType
public static MysqlType findMysqlType(PropertySet propertySet, int mysqlTypeId, short colFlag, long length, LazyString tableName, LazyString originalTableName, int collationIndex, String encoding)
-
read
public <T extends ProtocolEntity> T read(Class<T> requiredClass, ProtocolEntityFactory<T,NativePacketPayload> protocolEntityFactory) throws IOException
- 指定者:
read在接口中Protocol<NativePacketPayload>- 抛出:
IOException
-
read
public <T extends ProtocolEntity> T read(Class<Resultset> requiredClass, int maxRows, boolean streamResults, NativePacketPayload resultPacket, boolean isBinaryEncoded, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> protocolEntityFactory) throws IOException
从接口复制的说明:ProtocolRead protocol entity.- 指定者:
read在接口中Protocol<NativePacketPayload>- 类型参数:
T- object extending theProtocolEntity- 参数:
requiredClass- required Resultset classmaxRows- the maximum number of rows to read (-1 means all rows)streamResults- should the driver leave the results on the wire, and read them only when needed?resultPacket- the first packet of information in the result setisBinaryEncoded- true if the binary protocol is used (for server prepared statements)metadata- use this metadata instead of the one provided on wireprotocolEntityFactory-ProtocolEntityFactoryinstance- 返回:
ProtocolEntityinstance- 抛出:
IOException- if an error occurs
-
readNextResultset
public <T extends ProtocolEntity> T readNextResultset(T currentProtocolEntity, int maxRows, boolean streamResults, boolean isBinaryEncoded, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory) throws IOException
Read next result set from multi-result chain.- 类型参数:
T- extendsProtocolEntity- 参数:
currentProtocolEntity- T instancemaxRows- rows limitstreamResults- whether a stream result should be createdisBinaryEncoded- true for binary protocolresultSetFactory-ProtocolEntityFactory- 返回:
- T instance
- 抛出:
IOException- if an i/o error occurs
-
readAllResults
public <T extends Resultset> T readAllResults(int maxRows, boolean streamResults, NativePacketPayload resultPacket, boolean isBinaryEncoded, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory) throws IOException
- 抛出:
IOException
-
readServerStatusForResultSets
public final <T> T readServerStatusForResultSets(NativePacketPayload rowPacket, boolean saveOldStatus)
-
readQueryResult
public <T extends QueryResult> T readQueryResult(ResultBuilder<T> resultBuilder)
从接口复制的说明:ProtocolRead messages from server and deliver them to resultBuilder.- 指定者:
readQueryResult在接口中Protocol<NativePacketPayload>- 类型参数:
T- result type- 参数:
resultBuilder-ResultBuilderinstance- 返回:
QueryResult
-
getLocalInfileInputStream
public InputStream getLocalInfileInputStream()
从接口复制的说明:ProtocolReturns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement. This method returns NULL if no such stream has been set via setLocalInfileInputStream().- 指定者:
getLocalInfileInputStream在接口中Protocol<NativePacketPayload>- 返回:
- input stream
-
setLocalInfileInputStream
public void setLocalInfileInputStream(InputStream stream)
从接口复制的说明:ProtocolSets an InputStream instance that will be used to send data to the MySQL server for a "LOAD DATA LOCAL INFILE" statement rather than a FileInputStream or URLInputStream that represents the path given as an argument to the statement. This stream will be read to completion upon execution of a "LOAD DATA LOCAL INFILE" statement, and will automatically be closed by the driver, so it needs to be reset before each call to execute*() that would cause the MySQL server to request data to fulfill the request for "LOAD DATA LOCAL INFILE". If this value is set to NULL, the driver will revert to using a FileInputStream or URLInputStream as required.- 指定者:
setLocalInfileInputStream在接口中Protocol<NativePacketPayload>- 参数:
stream- input stream
-
sendFileToServer
public final NativePacketPayload sendFileToServer(String fileName)
Reads and sends a file to the server for LOAD DATA LOCAL INFILE- 参数:
fileName- the file name to send.- 返回:
- NativePacketPayload
-
getStreamingData
public ResultsetRows getStreamingData()
-
setStreamingData
public void setStreamingData(ResultsetRows streamingData)
-
checkForOutstandingStreamingData
public void checkForOutstandingStreamingData()
-
unsetStreamingData
public void unsetStreamingData(ResultsetRows streamer)
-
scanForAndThrowDataTruncation
public void scanForAndThrowDataTruncation()
-
generateQueryCommentBlock
public StringBuilder generateQueryCommentBlock(StringBuilder buf)
-
getMetricsHolder
public BaseMetricsHolder getMetricsHolder()
-
getQueryComment
public String getQueryComment()
从接口复制的说明:ProtocolReturns the comment that will be prepended to all statements sent to the server.- 指定者:
getQueryComment在接口中Protocol<NativePacketPayload>- 返回:
- query comment string
-
setQueryComment
public void setQueryComment(String comment)
从接口复制的说明:ProtocolSets the comment that will be prepended to all statements sent to the server. Do not use slash-star or star-slash tokens in the comment as these will be added by the driver itself.- 指定者:
setQueryComment在接口中Protocol<NativePacketPayload>- 参数:
comment- query comment string
-
convertShowWarningsToSQLWarnings
public SQLWarning convertShowWarningsToSQLWarnings(boolean forTruncationOnly)
Turns output of 'SHOW WARNINGS' into JDBC SQLWarning instances. If 'forTruncationOnly' is true, only looks for truncation warnings, and actually throws DataTruncation as an exception.- 参数:
forTruncationOnly- if this method should only scan for data truncation warnings- 返回:
- the SQLWarning chain (or null if no warnings)
-
readMetadata
public ColumnDefinition readMetadata()
- 指定者:
readMetadata在接口中Protocol<NativePacketPayload>
-
close
public void close() throws IOException- 指定者:
close在接口中Protocol<NativePacketPayload>- 抛出:
IOException
-
configureTimeZone
public void configureTimeZone()
Configures the client's timezone if required.- 指定者:
configureTimeZone在接口中Protocol<NativePacketPayload>- 抛出:
CJException- if the timezone the server is configured to use can't be mapped to a Java timezone.
-
initServerSession
public void initServerSession()
- 指定者:
initServerSession在接口中Protocol<NativePacketPayload>
-
-