Search in sources :

Example 1 with LongDataPacket

use of io.mycat.net.mysql.LongDataPacket in project Mycat-Server by MyCATApache.

the class ServerPrepareHandler method sendLongData.

@Override
public void sendLongData(byte[] data) {
    LongDataPacket packet = new LongDataPacket();
    packet.read(data);
    long pstmtId = packet.getPstmtId();
    PreparedStatement pstmt = pstmtForId.get(pstmtId);
    if (pstmt != null) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("send long data to prepare sql : " + pstmtForId.get(pstmtId));
        }
        long paramId = packet.getParamId();
        try {
            pstmt.appendLongData(paramId, packet.getLongData());
        } catch (IOException e) {
            source.writeErrMessage(ErrorCode.ERR_FOUND_EXCEPION, e.getMessage());
        }
    }
}
Also used : LongDataPacket(io.mycat.net.mysql.LongDataPacket) PreparedStatement(io.mycat.backend.mysql.PreparedStatement) IOException(java.io.IOException)

Aggregations

PreparedStatement (io.mycat.backend.mysql.PreparedStatement)1 LongDataPacket (io.mycat.net.mysql.LongDataPacket)1 IOException (java.io.IOException)1