When `PreparedStatement::getParameterMetaData` is performed for a query (for example, an insert query), the sql type for the parameters reports a wrong type, in fact, it is always VARSTRING.
From https://jira.mariadb.org/browse/CONJ-568, I understand it's because the MariaDB server doesn't return the parameter types, and I have a feeling in my case, the MySQL server isn't returning parameter types as well.
However, I personally feel this is wrong. Instead of returning a wrong type, it should throw an exception instead. See how MySql connector does it. Returning wrong types will lead downstream libraries to act on these wrong types and produce wrong results. If an exception is thrown, downstream libraries can act on the exception and perform other/fallback actions.
Because of MariaDB connector returning wrong values, I have to write code to specifically ignore parameter metadata if the jdbc connector is of MariaDB type.