You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/10/08 08:33:07 UTC

[GitHub] [incubator-shardingsphere] tristaZero commented on issue #3017: By Use EncryptDataSource the query with text column occurs error

tristaZero commented on issue #3017: By Use EncryptDataSource the query with text column occurs error
URL: https://github.com/apache/incubator-shardingsphere/issues/3017#issuecomment-539410501
 
 
   @Keanhua Hi, to make your issue recurred, i did some tests, but i can not get your exception.
   Here some detail of my test, is it similar with yours?
   #### Table description:
   ```
   CREATE TABLE `t_encrypt` (
     `id` int(11) NOT NULL,
     `pwd` text,
     `pwd_query` varchar(255) DEFAULT NULL,
     `name` text,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8
   ```
   #### Encrypt rule
   ```
   encryptRule:
     encryptors:
       encryptor_aes:
         type: AES
         props:
           aes.key.value: 1111
     tables:
       t_encrypt:
         columns:
           name:
             cipherColumn: name
             encryptor: encryptor_aes
   ```
   
   #### SQL
   > private static final String SELECT_SQL = "select pwd, name from t_encrypt ";
   ```
   @Test
       public void testSelect() throws Exception {
           try (Connection connection = dataSource.getConnection();
                Statement statement = connection.createStatement()) {
               ResultSet resultSet = statement.executeQuery(SELECT_SQL);
               while (resultSet.next()) {
                   System.out.println(resultSet.getString(1));
                   System.out.println(resultSet.getString(2));
               }
           }
       }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services