SQLServerDatabaseMetaData.getColumns -> IS_AUTOINCREMENT returns SMALLINT while JDBC defines it as BOOLEAN

Answered SQLServerDatabaseMetaData.getColumns -> IS_AUTOINCREMENT returns SMALLINT while JDBC defines it as BOOLEAN

  • Monday, April 12, 2010 11:52 AM
     
     

    I am running:

     

     

    Microsoft SQL Server 10.00.2531

    Microsoft SQL Server JDBC Driver 3.0 3.0.1119.0

     

     

    Calling DatabaseMetaData.getColumns() for a table and then checking the ResultSetMetaData reveals that the IS_AUTOINCREMENT column is reported by the ResultSetMetaData as being SMALLINT rather than STRING as it is defined in JDBC.

     

    Please advise.

All Replies

  • Tuesday, April 13, 2010 9:04 PM
    Moderator
     
     

    The metadata of the columns is not right, however if you use getString on the column you will still get a string as defined by JDBC and get YES or NO values.


    Mugunthan
  • Wednesday, April 14, 2010 5:43 AM
     
     
    Yes I know getString() should be used. However, will the problem be fixed in a future version of the JDBC driver?
  • Tuesday, May 11, 2010 8:35 PM
    Moderator
     
     Answered

    There are no immediate plans to fix it but it is possible this would be fixed in a future release.


    Mugunthan
  • Wednesday, December 01, 2010 12:53 PM
     
     

    Any news whether this has been or is planned to be fixed?

  • Thursday, October 25, 2012 12:58 PM
     
     

    Any news on this? The 4.0 driver still doesn't report this correctly.

    That information should be properly reported by the driver that claims to be JDBC compliant.


    • Edited by Shammat Thursday, October 25, 2012 12:58 PM
    •  
  • Thursday, October 25, 2012 1:02 PM
     
     

    however if you use getString on the column you will still get a string as defined by JDBC and get YES or NO values.


    Mugunthan

    That is not true. getString() returns "NO" even if the column was defined as an identity column.