Bug #113378 | Java enums in prepared statement for a VARCHAR throws exception | ||
---|---|---|---|
Submitted: | 8 Dec 2023 12:31 | Modified: | 29 Mar 2024 17:12 |
Reporter: | Cyril DE CATHEU | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | connector-j>=8.0.29 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[8 Dec 2023 12:31]
Cyril DE CATHEU
[22 Mar 2024 17:15]
Filipe Silva
Hi Cyril, Thank you for your interest in MySQL Connector/J and for taking the time to report this issue. Previous to version 8.0.29, Connector/J was making some loose assumptions with regard to type mapping of unsupported types. It was blindly converting to String without taking into consideration the type mapping defined in the JDBC specification, which was wrong. From 8.0.29 and above, Connector/J does its best to be more JDBC compliant and this is why this type conversion is not supported anymore. Your best option is to be specific about the data you are submitting to the database and converting it to String by yourself. This way you don't rely on a non-standard behavior that can change at any moment, as it did. I hope this clarifies your question.
[29 Mar 2024 17:12]
Cyril DE CATHEU
Hey Filipe, Makes sense. Thanks for the explanation.