db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: Oracle 9 and timestamp datatype
Date Fri, 10 Mar 2006 21:03:30 GMT
On 3/10/06, sebastien.arbogast@free.fr <sebastien.arbogast@free.fr> wrote:

> I'm using DdlUtils to analyze an Oracle 9i database structure using the
> following code :
>
> public void analyzeDb(ReferenceDatabase refDb){
> ...
>     OracleDataSource dataSource = new OracleDataSource();
>     dataSource.setURL("jdbc:oracle:thin:@" +
>                     refDb.getHostName() +
>                     ":" + refDb.getPort() +
>                     ":" + refDb.getSessionId());
>     dataSource.setUser(refDb.getUsername());
>     dataSource.setPassword(refDb.getPassword());
>     log.info("Connecting to " + dataSource.getURL() + "...");
>     Platform platform = PlatformFactory.createNewPlatformInstance("Oracle9");
>     platform.setDataSource(dataSource);
>     log.info("Building database model...");
>     Database database = platform.readModelFromDatabase(null, null,
>         refDb.getUsername(), null);
> ...
> }
>
> In the resulting Database object, Columns that have a TIMESTAMP datatype are
> assigned the OTHER jdbc datatype, despite the fact that the platform is created
> with platform name specification. Is it a known bug ?

This direction is largely dependent upon the capabilities of the JDBC
driver. First of all, you should make sure that you're using the
newest driver that works with your DB. Since you're using Oracle 9, I
suggest that you update to the 10g driver if you're not already using
it.
Then for Oracle, the JDBC type that the JDBC driver returns, often
depends on the native definition. E.g. if the TIMESTAMP in the
database uses a size specifier (e.g. TIMESTAMP(9) ), then the JDBC
driver cannot cope with it and returns OTHER. Unfortunately, there is
currently not much that DdlUtils can do about this.

cheers,
Tom

Mime
View raw message