I'm trying to connect to Oracle 10g via ddlutils.
Since my code works fine with DB2 and postgres i'm wondering why i couldn't get
it to work with Oracle using there jdbc driver (ojdbc14.jar or the special
debugging version).
Here's what i tried so far.
The code for postgres:
Class.forName("org.postgresql.Driver").newInstance();
PGSimpleDataSource ds = new PGSimpleDataSource();
ds.setDatabaseName("benchmarking");
ds.setUser("user");
ds.setPassword("user");
platform = PlatformFactory.createNewPlatformInstance(ds);
db = platform.readModelFromDatabase("benchmarking");
For Oracle I already tried some additional options for the DataSource like
setting the DriverType, Port, the DB-URL in various forms (with user and pw,
port etc).
The most common error is an NullPointerException when using the DataSource in
the createNewPlatformInstance
[
at
org.apache.ddlutils.PlatformFactory.createNewPlatformInstance(PlatformFactory.java:82)
at
org.apache.ddlutils.PlatformFactory.createNewPlatformInstance(PlatformFactory.java:120)
]
Using the function createNewPlatformInstance("oracle") instead of the
DataSource works but then the code line db =
platform.readModelFromDatabase("benchmarking"); thows another
NullPointerException
[
at org.apache.ddlutils.util.JdbcSupport.borrowConnection(JdbcSupport.java:134)
at
org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1713)
]
db = platform.readModelFromDatabase(DriverManager.getConnection(DBURL),
"benchmarking");
throws
[
at
org.apache.ddlutils.platform.JdbcModelReader.readTable(JdbcModelReader.java:572)
at
org.apache.ddlutils.platform.oracle.Oracle8ModelReader.readTable(Oracle8ModelReader.java:94)
]
Any ideas, hints, clues?!
Many thanks.
Claas
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer