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: Exceptions when using DdlUtils and Platform.readModelFromDatabase()
Date Fri, 23 Jun 2006 15:34:10 GMT
On 6/23/06, Shaun <shaun@shaunc.com> wrote:

> I've just found DdlUtils and I'm quite impressed by this package. I'm
> running into a bit of trouble trying to export schema from MSSQL
> databases, though.

<snip>

> Exception in thread "main" org.apache.ddlutils.DynaSqlException: java.sql.SQLException:
Invalid column name 'Zip'.
>         at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1706)
>         at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1684)
>         at com.mycompany.test.ddlutiltest.DdlUtilTest.main(DdlUtilTest.java:69)
>
> Trying to run it against "YetAnotherDb" throws this exception:
>
> Exception in thread "main" org.apache.ddlutils.DynaSqlException: java.sql.SQLException:
Incorrect syntax near the keyword 'Primary'.
>         at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1706)
>         at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1684)
>         at com.mycompany.test.ddlutiltest.DdlUtilTest.main(DdlUtilTest.java:69)
>
> In both of these cases the exception is being thrown from this line:
>
>         new DatabaseIO().write(p.readModelFromDatabase("MyDbName"),
> filename);
>
> I've tried several of the different signatures for
> readModelFromDatabase() and I wind up with the same exceptions no matter
> what I pass to it. Has anyone experienced similar issues? Am I using one
> of the DdlUtils methods incorrectly, or are the exceptions being thrown
> due to some problem with the database server?

These are SQL Exceptions and thus come from the database or the
driver. Unfortunately you left out the interesting part of the
stacktrace - there should be more to either one as the line where the
exception is thrown, PlatformImplBase.java:1706, is where the original
SQL exception is wrapped into a DdlUtils exception. There more
interesting place would be where this original SQL exception happens.
Please also note that DdlUtils is untested with jTDS, so there may be
some issues with the JDBC metadata capabilities of jTDS that result in
problems with DdlUtils.
Could you run your tests with the Microsoft Sql Server 2005 driver to
see whether the error occurs there as well ?

Tom

Mime
View raw message