I have a sql server database with some "Always Encrypted" columns. I was given the certificate to decrypt these and successfully tested with a java program using plain jdbc. The data in the columns returns fine.
However when I try to query them using mybatis 3.5.0 I get:
### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Encryption scheme mismatch for columns/variables 'customer_name'. The encryption scheme for the columns/variables is (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'Encryption_Key', column_encryption_key_database_name = 'DataWarehouse_user_readonly') and the expression near line '1' expects it to be (encryption_type = 'PLAINTEXT') (or weaker).
Here is what's in my configuration file:
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="UNPOOLED">
<property name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="url" value="jdbc:sqlserver://2SERVERDB;databaseName=DataWarehouse_user_readonly;integratedSecurity=true;columnEncryptionSetting=Enabled;keyStoreAuthentication=JavaKeyStorePassword;keyStoreLocation=EncryptionCertificate.pfx;keyStoreSecret=xxxxxx" />
</dataSource>
</environment>
</environments>
The same connection string url from above works fine with plain jdbc.
Any suggestions for this error?