vertx-jdbc-client
vertx-jdbc-client copied to clipboard
Added configuration to disable optimisticCast for Date, Time and Date…
The optimisticCast method is problematic when inserting Date values into a text or char field in the database, converting a parameter like '2019-08-16' to '2019-08-16 -06' with the timezone offset. I am submitting a pull request to enable or disable the optimisticCast for Date, Time and DateTime.
Hello team! Any chance I can get a review on this pull request to fix this database bug that could be affecting any vertx clients, @pmlopes or others?
This issue is also affecting me, any chance of merging this patch soon?
Thanks for the thumbs up @pasku . Once this is merged, you would be able to resolve these issues by configuring your JDBC connection like this: JsonObject jdbcConfig = new JsonObject(); jdbcConfig.put("url", configSite.getJdbcUrl()); jdbcConfig.put("driver_class", configSite.getJdbcClassePilote()); jdbcConfig.put("user", configSite.getJdbcUtilisateur()); jdbcConfig.put("password", configSite.getJdbcMotDePasse()); jdbcConfig.put("max_pool_size", configSite.getJdbcTailleMaxPiscine()); jdbcConfig.put("initial_pool_size", configSite.getJdbcTailleInitialePiscine()); jdbcConfig.put("min_pool_size", configSite.getJdbcTailleMinPiscine()); jdbcConfig.put("max_statements", configSite.getJdbcMaxDeclarations()); jdbcConfig.put("max_statements_per_connection", configSite.getJdbcMaxDeclarationsParConnexion()); jdbcConfig.put("max_idle_time", configSite.getJdbcTempsInactiviteMax()); jdbcConfig.put("castUUID", false); jdbcConfig.put("castDateTime", false); jdbcConfig.put("castTime", false); jdbcConfig.put("castDate", false); jdbcClient = JDBCClient.createShared(vertx, jdbcConfig); jdbcClient.getConnection(a -> { if (a.failed()) { LOGGER.error("Impossible d'ouvrir la connexion du client de base de données. ", a.cause()); future.fail(a.cause()); } else { LOGGER.info("La connexion du client de base de données a réussi. ");