求助大佬,可以使用flink table api读取strraocks吗,想要通过table api 进行flink-cdc的数据同步
代码如下,运行显示连接超时呢
public class SelectMysql {
public static void main(String[] args) {
TableEnvironment env = TableEnvironment.create(EnvironmentSettings.newInstance().inStreamingMode().build());
env.executeSql(“CREATE TABLE IF NOT EXISTS mysql_t
(\n” +
" table_name
varchar(255),\n" +
" datatypes
varchar(255)\n" +
“) with (\n” +
" ‘connector’ = ‘starrocks’,\n" +
" ‘jdbc-url’ = ‘’,\n" +
" ‘scan-url’ = ‘’,\n" +
" ‘username’ = ‘’,\n" +
" ‘password’ = ‘’,\n" +
" ‘database-name’ = ‘’,\n" +
" ‘table-name’ = ‘’\n" +
“);”);
Table mysqlT = env.from(“mysql_t”);
mysqlT.select(Expressions.$("*")).execute().print();
}
}