db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaun <sh...@shaunc.com>
Subject Re: Exceptions when using DdlUtils and Platform.readModelFromDatabase()
Date Fri, 23 Jun 2006 16:24:50 GMT
On Fri, 23 Jun 2006 17:34:10 +0200
"Thomas Dudziak" <tomdzk@gmail.com> wrote:

> 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 ?

Hi Tom,

Thanks for the swift response.

Firstly, I've tracked down one of the exceptions that I was getting;
there's a column in one of our tables named [Primary Buyer], and the
brackets are being stripped out of the column name at some point, thus
the word "Primary" shows up in the middle of the query. Great... :)

Here's a stack trace from the other exception, using the MSSQL driver
instead of Jtds:

Exception in thread "main" org.apache.ddlutils.DynaSqlException: com.microsoft.sqlserver.jdbc.SQLServerException:
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:52)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'Zip'.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
	at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteQuery(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
	at org.apache.ddlutils.platform.JdbcModelReader.determineAutoIncrementFromResultSetMetaData(JdbcModelReader.java:1028)
	at org.apache.ddlutils.platform.mssql.MSSqlModelReader.readTable(MSSqlModelReader.java:102)
	at org.apache.ddlutils.platform.JdbcModelReader.readTables(JdbcModelReader.java:505)
	at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:468)
	at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:428)
	at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1699)

Thanks,

Shaun

Mime
View raw message