java PostgreSQL+Openshift:对于给定的数据库URL,可能是错误的驱动程序?
我正试图从我拥有的Openshift
机器上运行liquibase更新。看起来像
> java -jar ~/.m2/repository/org/liquibase/liquibase-core/3.1.1/liquibase-core-3.1.1.jar --driver=org.postgresql.Driver --classpath=wildfly/standalone/deployments/ROOT.war --changeLogFile=liquibase/changelog.xml --url="jdbc:$OPENSHIFT_POSTGRESQL_DB_URL/mydb" --username=$OPENSHIFT_POSTGRESQL_DB_USERNAME --password=OPENSHIFT_POSTGRESQL_DB_PASSWORD update
我看到了下面的错误
Liquibase update Failed: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:postgresql://admin:29asDVjpFxYl6@127.8.201.2:5432/mydb with driver org.postgresql.Driver. Possibly the wrong driver for the given database URL
这里出了什么问题
我正在使用以下postgreSQL
依赖项
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
# 1 楼答案
有两个问题已修复,如下所示
a.)使用postgres 9.2驱动程序
b.)使用以下url