org.mariadb.jdbc.internal.com.send
Class ComQuery

java.lang.Object
  extended by org.mariadb.jdbc.internal.com.send.ComQuery

public class ComQuery
extends Object


Constructor Summary
ComQuery()
           
 
Method Summary
static void sendDirect(PacketOutputStream pos, byte[] sqlBytes)
          Send directly to socket the sql data.
static void sendDirect(PacketOutputStream pos, byte[] sqlBytes, int queryTimeout)
          Send directly to socket the sql data.
static void sendMultiDirect(PacketOutputStream pos, List<byte[]> sqlBytes)
          Send directly to socket the sql data.
static void sendMultiDirect(PacketOutputStream pos, List<byte[]> sqlBytes, int queryTimeout)
          Send directly to socket the sql data.
static int sendMultiple(PacketOutputStream writer, String firstQuery, List<String> queries, int currentIndex)
          Statement.executeBatch() rewritten multiple (concatenate with ";") according to max_allowed_packet)
static int sendRewriteCmd(PacketOutputStream pos, List<byte[]> queryParts, ParameterHolder[] parameters, int currentIndex, int paramCount, List<ParameterHolder[]> parameterList, boolean rewriteValues)
          Client side PreparedStatement.executeBatch values rewritten (concatenate value params according to max_allowed_packet)
static void sendSubCmd(PacketOutputStream writer, ClientPrepareResult clientPrepareResult, ParameterHolder[] parameters)
          Client-side PrepareStatement.execute() packet send.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComQuery

public ComQuery()
Method Detail

sendSubCmd

public static void sendSubCmd(PacketOutputStream writer,
                              ClientPrepareResult clientPrepareResult,
                              ParameterHolder[] parameters)
                       throws IOException
Client-side PrepareStatement.execute() packet send.

Parameters:
writer - outputStream
clientPrepareResult - clientPrepareResult
parameters - parameter
Throws:
IOException - if connection fail

sendRewriteCmd

public static int sendRewriteCmd(PacketOutputStream pos,
                                 List<byte[]> queryParts,
                                 ParameterHolder[] parameters,
                                 int currentIndex,
                                 int paramCount,
                                 List<ParameterHolder[]> parameterList,
                                 boolean rewriteValues)
                          throws IOException
Client side PreparedStatement.executeBatch values rewritten (concatenate value params according to max_allowed_packet)

Parameters:
pos - outputStream
queryParts - query parts
parameters - parameters
currentIndex - currentIndex
paramCount - parameter pos
parameterList - parameter list
rewriteValues - is query rewritable by adding values
Returns:
current index
Throws:
IOException - if connection fail

sendMultiple

public static int sendMultiple(PacketOutputStream writer,
                               String firstQuery,
                               List<String> queries,
                               int currentIndex)
                        throws IOException
Statement.executeBatch() rewritten multiple (concatenate with ";") according to max_allowed_packet)

Parameters:
writer - outputstream
firstQuery - first query
queries - queries
currentIndex - currentIndex
Returns:
current index
Throws:
IOException - if connection error occur

sendDirect

public static void sendDirect(PacketOutputStream pos,
                              byte[] sqlBytes)
                       throws IOException,
                              SQLException
Send directly to socket the sql data.

Parameters:
pos - output stream
sqlBytes - the query in UTF-8 bytes
Throws:
IOException - if connection error occur
SQLException - if packet max size is to big.

sendDirect

public static void sendDirect(PacketOutputStream pos,
                              byte[] sqlBytes,
                              int queryTimeout)
                       throws IOException,
                              SQLException
Send directly to socket the sql data.

Parameters:
pos - output stream
sqlBytes - the query in UTF-8 bytes
queryTimeout - timeout using max_statement_time
Throws:
IOException - if connection error occur
SQLException - if packet max size is to big.

sendMultiDirect

public static void sendMultiDirect(PacketOutputStream pos,
                                   List<byte[]> sqlBytes)
                            throws IOException,
                                   SQLException
Send directly to socket the sql data.

Parameters:
pos - output stream
sqlBytes - the query in UTF-8 bytes
Throws:
IOException - if connection error occur
SQLException - if packet max size is to big.

sendMultiDirect

public static void sendMultiDirect(PacketOutputStream pos,
                                   List<byte[]> sqlBytes,
                                   int queryTimeout)
                            throws IOException,
                                   SQLException
Send directly to socket the sql data.

Parameters:
pos - output stream
sqlBytes - the query in UTF-8 bytes
queryTimeout - timeout using max_statement_time
Throws:
IOException - if connection error occur
SQLException - if packet max size is to big.


Copyright © 2017. All rights reserved.