开始ktr资源库部署在服务器上能正常使用,然后将数据库部署到本地,再执行时就报错,用连接资源库代码测试,发现资源库连接失败。

import org.pentaho.di.core.KettleEnvironment;

import org.pentaho.di.core.database.DatabaseMeta;

import org.pentaho.di.repository.kdr.KettleDatabaseRepository;

import org.pentaho.di.repository.kdr.KettleDatabaseRepositoryMeta;

public class KettleconTest {

public static void main(String[] args) throws Exception {

//创建资源库对象,此时的对象还是一个空对象

KettleEnvironment.init();

//创建资源库数据库对象,类似我们在spoon里面创建资源库

KettleDatabaseRepository repository = new KettleDatabaseRepository();

//资源库元对象,名称参数,id参数,描述等,与数据库资源库中连接数据库信息对应

参考文章

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。