0

我已将 Informix jar 复制到 schemacrawler/lib

ifxjdbc.jar
ifxjdbcx.jar
ifxlang.jar
ifxlsupp.jar
ifxsqlj.jar
ifxtools.jar

我已将 ApiExample.java 中的 jdbc 连接更改为 Informix jdbc 连接字符串,以及用户名和密码

api.cmd 如下所示(此处未进行任何更改)

@echo off
del /f /q *.class
javac -classpath ../../_schemacrawler/lib/*;. ApiExample.java
java -classpath ../../_schemacrawler/lib/*;. ApiExample

但是当我运行 api.cmd 时出现以下错误

WARNING: Could not get a database driver for database connection URL jdbc:informix-sqli://someserver:1234/mydb:informixserver=test_shm
Exception in thread "main" java.lang.NullPointerException
at  schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.createConnectionProperties(BaseDatabaseConnectionOptions.java:292)
    at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:119)
    at ApiExampleInformix.main(ApiExampleInformix.java:25)

为什么 ApiExample.class 找不到 Informix jar?

提前致谢

4

1 回答 1

0

我查看了Load IBM Informix JDBC Driver,发现您需要先执行此操作:

Class.forName("com.informix.jdbc.IfxDriver");

Sualeh Fatehi,SchemaCrawler

于 2015-02-14T03:09:35.240 回答