Yes and no...
Several things come to mind.
An enum with a lookup method by column type that returns a handler for that column type is the most obvious.
Use a Map of column type names to enum instances for that.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Edit: Nevermind, silly me, thinking of something completely different.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
I am interested in your above method. But I still need to program differently for different column types to write equals (or compareTo) method, right?
Of course. How else are you going to get the data out of the resultset?
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
the JDBC API has several options that may work.
getBytes(int) and getObject(int) on ResultSet come to mind.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337