These seem reasonable. On the other hand, using getGeneratedKeys() to
determine the type & name of a table's generated key seems very very
unlikely to me. It would require that the application/tool can insert a
row of the correct shape, if the app/tool can do that, then it probably
already knows the columns's definition. Also some auto-discovering tool
seems unlikely to use getGeneratedKeys as it would require perturbing
the database by having a successful INSERT (though maybe a INSERT INTO
T(a,b,c) SELECT a,b,c FROM T WHERE 1=0 might work). Seems way too
contrived though to say getGeneratedKeys() is a useful tool for
gathering metadata.

Dan.
  
You are correct, a tool would use DatabaseMetaData and expect the column type returned from getGeneratedKeys()  to match the column defined in the table for the auto-generated key  in the case the identity column.

Reply via email to