如何使Schemacrawler与Informix 11.70数据库一起使用

时间:2015-02-13 18:33:59

标签: java informix schemacrawler

我已将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?

提前致谢

1 个答案:

答案 0 :(得分:0)

我看了Load IBM Informix JDBC Driver,发现你需要先做这件事:

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

Sualeh Fatehi,SchemaCrawler