H Paul wrote:1. Here is basic pseudo JDBC code
ResultSet rs= SELECT * FROM CodeDescription (Code, Description)
Loop thru RS
Map.put (rs,getInt(1), rs.getString(2);
return Map;
2. How I can achieve this with Spring?
1M Thanks.
We need more information. Spring isn't a JDBC implementation, so what do you want to use? Jdbc and with Spring's JdbcTemplate? Hibernate? Hibernate's implementation of JPA?
With JdbcTemplate there is a queryForMap method, where if you write your sql as a crosstab query, you can make the first column values be the column names and the description the values where you just pass the SQL
string to the queryForMap method.
But which data access technology you are using tells us a good deal of what
you should do.
Mark