org.mariadb.jdbc.message.client.PingPacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mariadb-java-client Show documentation
Show all versions of mariadb-java-client Show documentation
JDBC driver for MariaDB and MySQL
The newest version!
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2012-2014 Monty Program Ab
// Copyright (c) 2015-2024 MariaDB Corporation Ab
package org.mariadb.jdbc.message.client;
import java.io.IOException;
import org.mariadb.jdbc.client.Context;
import org.mariadb.jdbc.client.socket.Writer;
import org.mariadb.jdbc.message.ClientMessage;
/** Ping packet see COM_PING (https://mariadb.com/kb/en/com_ping/) */
public final class PingPacket implements ClientMessage {
/** default instance */
public static final PingPacket INSTANCE = new PingPacket();
@Override
public int encode(Writer writer, Context context) throws IOException {
writer.initPacket();
writer.writeByte(0x0e);
writer.flush();
return 1;
}
}