tpickle-amazon commented on issue #3261: URL: https://github.com/apache/hop/issues/3261#issuecomment-1832460760
One potential approach might be to use the `ClientInfo` functionality of the JDBC: https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#setClientInfo-java.util.Properties. Based on [these docs](https://dev.mysql.com/doc/connector-j/en/connector-j-connp-props-connection.html)(see `clientInfoProvider`) it seems like JDBC Driver implementations (such as Mysql) can support `ClientInfo` in different ways. Based on the above doc, the default `clientInfoProvider` for MySql is `com.mysql.cj.jdbc.CommentClientInfoProvider` which injects the `ClientInfo` properties as comments into the query. So wondering if it would better align with the JDBC interface/library to use `ClientInfo` properties instead of `getSqlComment()`. Rather than adding: ``` interface IDatabase { String getSqlComment(); } ``` could have: ``` interface IDatabase { Properties getClientInfoProperties(); } ``` then during the `connect()` routine of the main `Database.java` have something like: ``` if databasePlugin.getClientInfo() != null { connection.setClientInfo(databasePlugin.getClientInfoProperties()); } ``` and let the JDBC driver implementation handle the specifics (in our case this would be Mysql + `CommentClientInfoProvider`). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
