-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PreparedStatement add objects misbehaviour. #1959
Comments
@IvanHdzC Currently timestamps are inserted as Strings or using objects? What is the best way? |
Actually that's the problem. I tried both (setObject and setString) but none of them worked. There is an specific |
Ideally (jdbc native way) all work should be done by https://github.com/telefonicaid/fiware-cygnus/blob/master/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/sql/SQLQueryUtils.java#L351 |
PreparedStatement is still in use in this loop: fiware-cygnus/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/sql/SQLBackendImpl.java Lines 631 to 638 in 29abcc5
But is not really properly used, since each loop iteration is creating a new "preparedStatement" and the current iteration of loop is not using capabilities of a prepared statement (just change one o few value from created statement). |
When inserting JsonObjects as SQL objects into a PreparedStatement.
com.telefonica.iot.cygnus.backends.sql.SQLQueryUtils.addJsonValues
It's having trouble with some SQL objects (The ones identified are Timestamp with TZ and functions). The class apparently has no trouble but when connecting to the database the driver asks to casts objects to proper types.
The text was updated successfully, but these errors were encountered: