简体   繁体   English

为什么ResultSet meteData getColumnName得到所有大写的列名

[英]Why ResultSet meteData getColumnName got all Upper case column name

My query like below: 我的查询如下:

select a "Column A" from table

and I am using 我正在使用

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

I got the column name as "COLUMN A" rather than "Column A". 我得到的列名称为“ COLUMN A”而不是“ Column A”。 I tried to use" 我尝试使用”

select a as ColumnA from table

Still got "COLUMN A" 仍然获得“ COLUMN A”

Why ResultSet meteData getColumnName got all Upper case column name? 为什么ResultSet meteData getColumnName得到所有大写的列名? How can I get the lowercase instead? 如何获取小写字母呢?

getColumnName(i) always returns the designated column's name, so, this problem is not related with the method but your database. getColumnName(i)始终返回指定列的名称,因此,此问题与方法无关,而与数据库有关。
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. 更新:我将这种方法与MYSql和Sqlite以及MS Acces一起使用,我没有遇到任何类似的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM