views:

45

answers:

1

I am not able to read oracle database with ddlutils and getting following error:

java.lang.NullPointerException at org.apache.ddlutils.platform.JdbcModelReader.readTable(JdbcModelReader.java:573) at org.apache.ddlutils.platform.oracle.Oracle8ModelReader.readTable(Oracle8ModelReader.java:102) at org.apache.ddlutils.platform.JdbcModelReader.readTables(JdbcModelReader.java:516) at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:472) at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:432) at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1884) at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1869)

Code:

OracleDataSource ds = new OracleDataSource();
ds.setDatabaseName("PE7DEV_COTTON"); 
ds.setURL("jdbc:oracle:thin:@localhost:1521:localdb");
ds.setUser("PE7DEV_COTTON");
ds.setPassword("PE7DEV_COTTON");
Platform platform = PlatformFactory.createNewPlatformInstance(ds);
Database db = platform.readModelFromDatabase("PE7DEV_COTTON");`

It seems ddlutils is not able to recognise oracle 10g instead it is using Oracle8ModelReader. Has anybody faced the same issue? `

A: 

You could try looking at the source code to see what code causes the null pointer exception. That should tell you more about what is wrong.

Jon