dangmingyang opened a new issue, #37515:
URL: https://github.com/apache/shardingsphere/issues/37515

   ## Question
   
   **For English only**, other languages will not accept.
   
   Before asking a question, make sure you have:
   
   - Googled your question.
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   The proxy-frontend-database-protocol-type specified for my 
ShardingSphere-Proxy is MySQL. I have also added new storage units and 
encryption rules to the ZooKeeper governance center via this 
ShardingSphere-Proxy.
   ```
   REGISTER STORAGE UNIT  `test_jdbc`  (
       URL = 'jdbc:oracle:thin:@//192.168.30.159:1521/ORCL',
       USER = 'C##APP_USER',
       PASSWORD = '123456',
       PROPERTIES('maxPoolSize' = '50')
   );
   
   CREATE ENCRYPT RULE `user_name` (COLUMNS ( 
        (NAME = pwd,CIPHER = pwd, ENCRYPT_ALGORITHM ( TYPE ( NAME = 
'DBESShardingEncrypt', PROPERTIES ( 'sm3' = 1, 'sm4-key' = 
'12b366c7c59b4f949bbae8a6f1630611'))) )));
   ```
   Then, when my ShardingSphere-JDBC connects to this Oracle database via this 
governance center, the SQL statement in my Java program is as follows:
   ``` 
   @Insert("INSERT INTO \"user_name\" (\"id\", \"username\", \"pwd\") VALUES 
(#{id} ,#{username}, #{pwd})")
   int insert(User user);
   ```  
   However, the result translated by ShardingSphere-JDBC and sent to the 
database for execution is as follows:
   ```
   Logic SQL: INSERT INTO "user_name" ("id", "username", "pwd") VALUES (? ,?, ?)
   Actual SQL: test_jdbc ::: INSERT INTO "user_name" ("id", "username", `pwd`) 
VALUES (?, ?, ?) ::: [6, asssf, 
#DBESV1#0000000Axxsfsdfsdf3VEi3gA6wEH9lLtr08B4Dba3/yimIkuqv4nobN3REZk=]
   ### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: 
ORA-00911
   ```
   I noticed that the double quotes (") surrounding the encrypted field pwd 
have been converted to backticks (`).  This does not seem to be a syntax 
supported by Oracle; instead, it looks like MySQL syntax. 
   What causes ShardingSphere-JDBC to translate this SQL statement into a 
MySQL-specific one? Is it because the proxy-frontend-database-protocol-type of 
the ShardingSphere-Proxy (which executes the DistSQL) is set to MySQL? 
   If this is the case, how should I configure the Oracle database correctly? I 
noticed that there is no option for ORACLE in the 
proxy-frontend-database-protocol-type configuration.


-- 
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]

Reply via email to