I want to get the value of a MySQL variable (example: max_allowed_packet
) via jdbcTemplate. is this possible? if so, how ?
In SQL, I can do SHOW VARIABLES LIKE 'max_allowed_packet';
but how to do this via JDBCTemplate ?
I want to get the value of a MySQL variable (example: max_allowed_packet
) via jdbcTemplate. is this possible? if so, how ?
In SQL, I can do SHOW VARIABLES LIKE 'max_allowed_packet';
but how to do this via JDBCTemplate ?
2
Answers
I was particularly interested in getting the
max_allowed_packet
variable from the database. This below snippet does the trick.Here is a solution
Variable class:
VariableRowMapper class:
hope it helps.