JiekerTime opened a new issue #11757: URL: https://github.com/apache/shardingsphere/issues/11757
### Which version of ShardingSphere did you use? 5.0.0-RC1-SNAPSHOT ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ShardingSphere-Proxy ### Expected behavior  ### Actual behavior Prints out the meta information of all forms in the database:  ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. Create the test code as follows.: ``` public class MetaDataTest { private DataSource createDataSource() { HikariConfig result = new HikariConfig(); result.setDriverClassName("com.mysql.jdbc.Driver"); result.setJdbcUrl("jdbc:mysql://localhost:3307/db?useServerPrepStmts=true&serverTimezone=UTC&useSSL=false&useLocalSessionState=true&characterEncoding=utf-8"); result.setUsername("root"); result.setPassword("root"); result.setMaximumPoolSize(2); result.setTransactionIsolation("TRANSACTION_READ_COMMITTED"); result.setConnectionInitSql("SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))"); return new HikariDataSource(result); } @Test public void metadataTest() { List<DataSetColumn> result = new LinkedList<>(); try (Connection connection = createDataSource().getConnection()) { DatabaseMetaData metaData = connection.getMetaData(); try (ResultSet resultSet = metaData.getColumns(null, null, "t_order", null)) { while (resultSet.next()) { DataSetColumn each = new DataSetColumn(); System.out.println("COLUMN_NAME: " + resultSet.getString("COLUMN_NAME")); each.setName(resultSet.getString("COLUMN_NAME")); System.out.println("TYPE_NAME: " + resultSet.getString("TYPE_NAME").toLowerCase()); each.setType(resultSet.getString("TYPE_NAME").toLowerCase()); result.add(each); System.out.println("--------"); } } } catch (SQLException e) { e.printStackTrace(); } System.out.println(result); } } ``` -- 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]
