2

我的查询如下:

select a "Column A" from table

我正在使用

ResultSetMetaData metaData = rs.getMetaData();
metaData.getColumnName();

我得到的列名是“COLUMN A”而不是“Column A”。我尝试使用“

select a as ColumnA from table

仍然得到“A列”

为什么 ResultSet meteData getColumnName 得到所有大写的列名?我怎样才能得到小写字母?

4

1 回答 1

1

getColumnName(i) always returns the designated column's name, so, this problem is not related with the method but your database.
I think you've better check your database and see how the column names set.

UPDATE: I used this method with MYSql and Sqlite and MS Acces, I didn't face any problem like that.

于 2013-07-02T20:59:50.230 回答