Mar 10th, 2010, 06:23 AM
Getting column count and names
I'm writing an application, which will make various queries to various databases. It will get query and DB information from own DB. Column counts in queries are different. I need column count to render table of user interface. I don't know how to get column count when using query method of SimpleJdbcTemplate. In simple JDBC usage (non-Spring), it is possible to get this metadata from getMetaData method of ResultSet. Please, help to get this metadata (column count, name and datatype) using Spring JDBC.
Mar 10th, 2010, 08:34 AM
Depending on which query you execute you get a List with Maps of results, the map contains as many elements as that there are columns. The list contains the amount of rows from the resultset. Everything is there why resort to the resultset.
Tags for this Thread