Menu

#117 Error using SQLServer2005 and latest MS JDBC driver

open
5
2010-10-11
2010-10-11
No

[java] Using database properties:
[java] [C:\Express\Trunk\3rdparty\SchemaSpy_5.0.0\lib\schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/mssq
l05.properties
[java] Gathering schema details....................................................................................
........................................................................................................................
........................................................................................................................
.................................................................................
[java] Failed to retrieve table/view comments: com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data
type is not supported.
[java] SELECT i_s.TABLE_NAME, s.value AS comments FROM INFORMATION_SCHEMA.Tables i_s INNER JOIN sys.extended_proper
ties s ON s.major_id = OBJECT_ID(i_s.table_catalog + '..' + i_s.table_name) WHERE s.class = 1 AND s.name = 'MS_Descripti
on'
[java] 09:45:15.166 SEVERE: TDSParser.throwUnexpectedTokenException - ConnectionID:1: getNextResult: Encountered u
nexpected unknown token (0x49)
[java] 09:45:15.182 SEVERE: TDSReader.throwInvalidTDS - ConnectionID:1 got unexpected value in TDS response at off
set:45
[java]
[java] Failed to retrieve column comments: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is close
d.
[java] SELECT OBJECT_NAME(c.object_id) AS TABLE_NAME, c.name AS COLUMN_NAME, ex.value AS comments FROM sys.columns
c LEFT OUTER JOIN sys.extended_properties ex ON ex.major_id = c.object_id AND ex.minor_id = c.column_id AND ex.name = 'M
S_Description' WHERE OBJECTPROPERTY(c.object_id, 'IsMsShipped')=0 ORDER BY OBJECT_NAME(c.object_id), c.column_id
[java] com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
[java] at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
[java] at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.checkClosed(SQLServerDatabaseMetaData.java:115
)
[java] at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getImportedKeys(SQLServerDatabaseMetaData.java
:911)
[java] at net.sourceforge.schemaspy.model.Table.connectForeignKeys(Table.java:106)
[java] at net.sourceforge.schemaspy.model.Database.connectTables(Database.java:984)
[java] at net.sourceforge.schemaspy.model.Database.<init>(Database.java:83)
[java] at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:211)
[java] at net.sourceforge.schemaspy.Main.main(Main.java:42)
[java] Java Result: 1

Discussion

  • Kevin Schmidt

    Kevin Schmidt - 2010-10-11

    BTW, it does work when I use "mssql05-jtds" and the jTDS jar, but we are trying on consolidate down to a single driver. Also, John, it was nice to meet you at the Riot party at JavaOne!!!

     
  • John Currier

    John Currier - 2010-10-11

    Hey Kevin! Riot's HR girl was definitely "interesting" ;)

    Unfortunately the only solution I'm aware of for the variant data type error is to use the jTDS driver. If you're unable to use that driver and you can come up with a query that works then you can modify selectColumnCommentsSql in the .properties file and point to the new file with -t.

    It's cool to hear from someone from JavaOne!

    Let me know how you resolve it,
    John

     

Log in to post a comment.