使用java生成liquibase更改日志

时间:2015-06-20 18:51:57

标签: java oracle

我正在尝试通过changelog xml输出java文件。

我不确定我需要将参数作为参数传递给以下方法。

liquibase.generateChangeLog("chris", changeLogWriter, outputStream, snapshotTypes);

Chrisschema name中的Oracle 11g XE

我不想在命令行上生成。我想使用我正在构建的应用程序来生成它。

public class Test {
    public static void main(String[] args) {
        String driverName = "oracle.jdbc.driver.OracleDriver";
        String dbURL = "jdbc:oracle:thin:@localhost:1521:xe";
        String userName = "chris";
        String userPwd = "Liberty123";

        try {
            Class.forName(driverName);
            Connection c = DriverManager.getConnection(dbURL, userName, userPwd);
            System.out.println("success");
            Liquibase liquibase = null;
            try {
                Database liqui_oracle = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(c));
                liquibase = new Liquibase("", new FileSystemResourceAccessor(), liqui_oracle);
                liquibase.generateChangeLog("chris", changeLogWriter, outputStream, snapshotTypes);

0 个答案:

没有答案