I'm having a problem with Java console and workbench. Let's start saying I'm using the sql.Date format in java console, and DATE format in the Workbench. I have windows 10 Pro on my laptop, using IntelliJ 2022.3.2 Community edition as IDE, MYSQL with workbench 8.0.32 community edition and mysql-connector-j-8.0.31. From Java console I want to update my birthdate which is already store in the database. So I take in input the date 1994-06-10, prepare the connection, prepare the query.. at the moment that is getting the query, the value is correct (1994-06-10) but if fills the '?' of my query with 1994-06-09, one day less. picture here I printed to make sure the data was stored right, and as you can see it's 1994-06-10, but still the query get filled with one day less. I tried to set the timezone but I think it is right. Do you guys know how can I solve this issue?
I saw in another topic they said it was fault of the mysql connector older version, so I tried to download the latest and still get the same error.