Class MySql


public final class MySql extends ServerSession

A MySQL client speaking the client/server protocol directly, for the same reason as Postgres: a translated server binary has no JDBC.

Everything goes through prepared statements (COM_STMT_PREPARE / EXECUTE) and therefore through MySQL's BINARY result format. That is more code than sending COM_QUERY text, and it is the only way to bind a parameter -- a text-protocol client has to build SQL by concatenation, and this API refuses to offer that. The exception is a statement the server refuses to prepare, which binds nothing and goes as text; see command(String).

Authentication covers what is actually deployed: caching_sha2_password (the MySQL 8 default) and mysql_native_password (5.7 and MariaDB). The caching_sha2 FULL exchange -- which the server demands the first time a password is used, before its cache is warm -- sends the password to the server, so this client does it only on a TLS connection and says so rather than falling back to the RSA-wrapped variant, which would be a second cryptographic path to get wrong.