Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.1.3
-
None
-
None
Description
MySQL Connector/J's PreparedStatement class outputs the generated SQL Statement when toString() is called. This is used for logging in applications. Example of the output:
com.mysql.jdbc.PreparedStatement@500fbfa2: SELECT id FROM table WHERE someRow='abc'
As one can see, it is trivially to parse the SQL statement from the output of toString() - just get the string after the substring ": ". Or even more simple, just logging the output of toString() might suffice for some logs.
I have an application which is originally written with Connector/J in mind. If I use Connector/J, I get useful log output - it even outputs the statement with the parameter values set.
It would generally reduce cost for application developers if the MariaDB Java Client would output the statement that way, too - for example, the returned String could look like this:
org.mariadb.jdbc.MySQLPreparedStatement@500fbfa2: SELECT id FROM table WHERE someRow='abc'