parent
7f06fce230
commit
85a6ef7ef4
@ -0,0 +1,32 @@
|
||||
package UnitTest;
|
||||
|
||||
import com.dsideal.FengHuang.Util.ClickHouseUtil;
|
||||
import com.jfinal.kit.PropKit;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.jfinal.plugin.activerecord.CaseInsensitiveContainerFactory;
|
||||
import com.jfinal.plugin.druid.DruidPlugin;
|
||||
|
||||
public class StructMysqlToClickHouse {
|
||||
public static void main(String[] args) {
|
||||
//告之配置文件位置
|
||||
PropKit.use("application.properties");
|
||||
//安装地区
|
||||
String user = PropKit.get("user");
|
||||
String password = PropKit.get("password");
|
||||
String jdbcUrl = PropKit.get("jdbcUrl");
|
||||
DruidPlugin hp = new DruidPlugin(jdbcUrl, user, password);
|
||||
hp.start();
|
||||
|
||||
// 配置ActiveRecord插件
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(hp);
|
||||
//配置默认小写
|
||||
arp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
|
||||
arp.start();
|
||||
|
||||
//转换的表名称
|
||||
String dbName = "fenghuang_db";
|
||||
String tableName = "t_base_organization";
|
||||
String s = ClickHouseUtil.getSql(dbName, tableName);
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue