ppourali opened a new issue #4317: Use encrypt-raw-jdbc-example fails because 
of "Unsupport SQL of " error
URL: https://github.com/apache/incubator-shardingsphere/issues/4317
 
 
   ## Question
   Hi, I am trying to run the encrypt example from the github repo. The example 
uses encryption rules to insert rows in the table and then prints them. 
However, when I run the example I get the following error.
   `
   Exception in thread "main" 
org.apache.shardingsphere.sql.parser.exception.SQLParsingException: Unsupported 
SQL of `TRUNCATE TABLE t_user`
        at 
org.apache.shardingsphere.sql.parser.core.parser.SQLParserEngine.parse(SQLParserEngine.java:77)
        at 
org.apache.shardingsphere.sql.parser.core.SQLParseKernel.parse(SQLParseKernel.java:58)
        at 
org.apache.shardingsphere.sql.parser.SQLParseEngine.parse0(SQLParseEngine.java:70)
        at 
org.apache.shardingsphere.sql.parser.SQLParseEngine.parse(SQLParseEngine.java:52)
        at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.EncryptStatement.getRewriteSQL(EncryptStatement.java:106)
        at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.EncryptStatement.executeUpdate(EncryptStatement.java:141)
        at 
org.apache.shardingsphere.example.core.jdbc.repository.UserRepositoryImpl.truncateTable(UserRepositoryImpl.java:64)
        at 
org.apache.shardingsphere.example.core.jdbc.service.UserServiceImpl.initEnvironment(UserServiceImpl.java:39)
        at 
org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate.run(ExampleExecuteTemplate.java:28)
        at 
org.apache.shardingsphere.example.encrypt.table.raw.jdbc.JavaConfigurationExampleMain.main(JavaConfigurationExampleMain.java:37)
   `
   
    This error is shown for every single sql statement (insert, update, create 
table, ...) and I don't understand why. The only thing that I changed in the 
example is that I changed it from Hikari to postgres driver:
   `
   BasicDataSource dataSource = new BasicDataSource();
   dataSource.setDriverClassName("org.postgresql.Driver");
   dataSource.setUrl("jdbc:postgresql://127.0.0.1:5432/" + dataSourceName);
   dataSource.setUsername(USER);
   dataSource.setPassword(PASS);
   `
   
   I can see that the connection is established successfully. I appreciate if 
you could kindly helo me with this. 
   
   Thanks,
   Parsa

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to