kettle 创建资源库 Java api DatabaseRepository
创建资源库
前置
- mysql
- 数据库 test
核心代码
KettleEnvironment.init();
DatabaseMeta databaseMeta = new DatabaseMeta("test-db", "MYSQL", "Native", "localhost",
"test1", "3306", "root", "toor@1234");
// 关闭mysql推荐SSL连接提示
databaseMeta.addExtraOption("MYSQL", "useSSL", "false");
repositoryMeta = new KettleDatabaseRepositoryMeta("test-repo", "test-repo", "test-repo", databaseMeta);
repository = new KettleDatabaseRepository();
repository.init(repositoryMeta);
repository.connectionDelegate.connect(true, true);
KettleDatabaseRepositoryCreationHelper helper = new KettleDatabaseRepositoryCreationHelper(repository);
helper.createRepositorySchema(null, false, new ArrayList<>(), false);
repository.connect("admin", "admin");
assertTrue(repository.isConnected());
本文来自博客园,作者:vx_guanchaoguo0,转载请注明原文链接:https://www.cnblogs.com/guanchaoguo/p/17061352.html