-
Notifications
You must be signed in to change notification settings - Fork 1
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
Error when using Always Encrypted and Update record #16
Comments
Hi, The best would be to do a little Java program on the server that encrypts/decryts a column and make sure all is OK. I will try some tests, but I have no experience using Always Encrypted with Java and a JDBC Driver, it may take some time... |
Hi, When using SQL instead of AceQL I do this:
When using DbType and Size, then it works. Always Encrypted columns can now be read with the SQL select statement and are decrypted by Java / Tomcat. |
When using SQL instead of AceQL: all tests must be done in Java, there is no C# involved on server side. |
I have found this on the error you reported: The whole guide is very complete: |
It works with Java when I use named parameters, when writing the complete query without parameters the same error as before pops up. Does AceQL make query's with or without named parameters ? |
This is is normal that it works with Java when using named parameters ( aka "?" substitutions). It is explained here: Yes, AceQL on the server makes all Java/JDBC queries with named parameters if the C# query has at least one parameter. |
Where are the parameters created? I can't find them. It should be like setstring() what can be changed to setNstring() in java. |
Could you please more specific ? Give a lot more details? I don't understand the exact meaning of the question. Parameters on Java server side are created in ServerStatement by ServerPreparedStatementParametersUtil Also, can you please send the Java code you mentioned that succeeds with named parameters? |
Sorry for the delay. What should be created is that you can update a record and tell java what kind of field should be used, example: update culumn "Name" with content "Billy" as NVARCHAR(50). The program now only can update culumn "Name" with content "Billy", but it can not specify the type of column that should be updated. With Always Encrypted you should specify the columntype for the field else the JDBC tries to update a record with the wrong column type and that will not work . Is it possible to fix that ? |
Hi, |
Hi, This is an example:
|
I got this error when updating a record when updating a record with columns which are encrypted.
Operand type clash: varchar(14) encrypted with (encryption_type = 'RANDOMIZED', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'WCCASHDESK') collation_name = 'Latin1_General_CI_AS' is incompatible with nvarchar(50) encrypted with (encryption_type = 'RANDOMIZED', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'WCCASHDESK')
The used sql command is this:
The text was updated successfully, but these errors were encountered: