机器:
Windows 10
java版本“ 1.8.0_181” Java(TM)SE运行时环境(内部版本1.8.0_181-b13) Java HotSpot(TM)客户端VM(内部版本25.181-b13,混合模式)
用于Windows的JDBC驱动程序6.0复制到: C:\ Dev \ JDBC
liquibase 3.5.5复制到: C:\ Dev \ liquibase
我的liquibase.properties文件是:
classpath="C:\\Dev\\JDBC\\sqljdbc42.jar"
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url="jdbc:SQLEXPRESS@localhost:1433:DBName01;integratedSecurity=true;"
referenceUrl="jdbc:SQLEXPRESS@localhost:1433:DBName02;integratedSecurity=true;"
我在命令行上运行liquibase diff
,但收到此错误:
C:\ Dev \ liquibase> liquibase diff运行Liquibase发生意外错误: C:\ Dev \ liquibase \“ C:\ Dev \ JDBC \ sqljdbc42.jar”不存在
严重18/9/19下午7:55:liquibase: C:\ Dev \ liquibase \“ C:\ Dev \ JDBC \ sqljdbc42.jar”不存在 liquibase.exception.CommandLineParsingException: C:\ Dev \ liquibase \“ C:\ Dev \ JDBC \ sqljdbc42.jar”不存在 在liquibase.integration.commandline.Main.configureClassLoader(Main.java:828)上 在liquibase.integration.commandline.Main.run(Main.java:187) 在liquibase.integration.commandline.Main.main(Main.java:103)
有关更多信息,请使用--logLevel标志
我已将sqljdbc42.jar复制到C:\ Dev \ liquibase \ lib,以及C:\ Dev \ JDBC,并将其包含在CLASSPATH中。我应该如何指定此文件的路径,以便liquibase可以找到它?
谢谢!
答案 0 :(得分:0)
我在属性文件中将类路径定义为
driver: org.postgresql.Driver
url: jdbc:postgresql://myhost-dbcluster.cluster-c888884ay77jcesov.us-east-1.rds.amazonaws.com:5432/mydb
classpath: C:/Users/Documents/liquibase/lib/postgresql-42.2.16.jar
username: appuser
password: appreal001
答案 1 :(得分:0)
将 postgresql-42.2.16.jar 放在 liquibase 文件夹位置,它会起作用
驱动程序:org.postgresql.Driver 网址:jdbc:postgresql://myhost-dbcluster.cluster-c888884ay77jcesov.us-east-1.rds.amazonaws.com:5432/mydb 类路径:postgresql-42.2.16.jar 用户名:appuser 密码:appreal001