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.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. |
- Re: behavior of Statement.getGeneratedKeys() Lance J. Andersen
- Re: behavior of Statement.getGeneratedKeys() Kathey Marsden
- Re: behavior of Statement.getGeneratedKeys() Rick Hillegas
- Re: behavior of Statement.getGeneratedKeys(... Kathey Marsden
- Re: behavior of Statement.getGeneratedK... Lance J. Andersen
- Re: behavior of Statement.getGenera... Daniel John Debrunner
- Re: behavior of Statement.getG... Lance J. Andersen
- Re: behavior of Statement.getGeneratedKeys(... Daniel John Debrunner
- Re: behavior of Statement.getGeneratedK... Rick Hillegas
- Re: behavior of Statement.getGenera... Daniel John Debrunner
- Re: behavior of Statement.getG... Lance J. Andersen
- Re: behavior of Statement.getGenera... Kathey Marsden
- Re: behavior of Statement.getG... Daniel John Debrunner
- Re: behavior of Statement.... Lance J. Andersen
- Re: behavior of Statement.... Rick Hillegas
- Re: behavior of Statement.... Kathey Marsden
- Re: behavior of Statement.... Rick Hillegas
- Re: behavior of Statement.... Lance J. Andersen
- Re: behavior of Statement.... Daniel John Debrunner
- Re: behavior of Statement.... Lance J. Andersen
- Re: behavior of Statement.... Daniel John Debrunner