Skip to content

Content Tagged "column"

Page 1 of 1

Content Tagged "column"

List Columns in a ResultSet

December 8, 2016Categories: Software, Tutorial
In order to list all columns in a JDBC ResultSet (e.g. for debug purposes), you need to iterate through its metadata: Note: Column numbers start from 1, not 0 (hence the md.getColumnName(i + 1) above). I usually wrap this in a if(logger.isTraceEnabled()) so it doesn't get triggered all the…

Add Primary Key Column to PostgreSQL Table

March 23, 2015Category: Software
The other day I got a question: How to add a numeric PK column to an already existent table? A quick look on the net showed that it is indeed possible to add an auto-incrementing PK to an already existing table ( if you don't have already a PK that is! ). The code is quite simple too! The statement…

All tags