Hi Ali,
Since I am currently using an Oracle database, and since I saw no mention in your post of the database you are using, I can only hope that the following will be relevant for you. In any case, the way I overcome this problem with my Oracle database, and Oracle's (thin)
JDBC driver, is to use
column aliases, for example:
Of-course, the aliases are completely arbitrary. What I have used above is purely an example to help illustrate my meaning. Feel free to use any alias that you are comfortable with.
Then, using the above example, the column names returned by the "ResultSetMetaData" object (again, for an Oracle database, using Oracle's JDBC driver) will be as follows:
t1c1
t1c2
t2c2
Good Luck,
Avi.