Re: The field name of the query result becomes uppercase
Hello! Are you sure it's Ignite's SQL? Since this statement does not look like something Ignite will accept. In Ignite you can use double quotes to specify case-sensitive spelling: "GameType". Then I expect identifiers will be considered case-sensitive and will need to be specified in double quotes. Regards, -- Ilya Kasnacheev вт, 5 мар. 2019 г. в 12:54, gn01887818 : > table schema: > CREATE TABLE `Wa` ( > `GameType` smallint(5) unsigned NOT NULL DEFAULT 0 > ); > > > ResultSet rs = conn.createStatement().executeQuery("select GameType from > Wa"); > > ResultSetMetaData resultSetMetaData = rs.getMetaData(); > > String name=getMetaData.getColumnLabel(1); > > The name here is GAMETYPE, not GameType? > > Because I need to take the name to do the processing, but found that the > name of the field defined by tale scheam is different. > Seems to be all uppercase > > Do you have any additional settings to do? > > Can make > String name=getMetaData.getColumnLabel(1); > > name will be the GameType > > Thank you > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
Re: The field name of the query result becomes uppercase
Hi, No, it's not possible to do because all the fields in Ignite SQL should be mapped to java fields. However, in java you can do next: @QuerySqlField private java.lang.String id; @QuerySqlField private java.lang.String Id; here id and Id will be different fields. But in H2 SQL engine expects the case insensitive fields. So one field in SQL could be mapped to two fields in JAVA. You can see the details in this ticket https://issues.apache.org/jira/browse/IGNITE-1338 (it closed as won't fix) BR, Andrei -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
The field name of the query result becomes uppercase
table schema: CREATE TABLE `Wa` ( `GameType` smallint(5) unsigned NOT NULL DEFAULT 0 ); ResultSet rs = conn.createStatement().executeQuery("select GameType from Wa"); ResultSetMetaData resultSetMetaData = rs.getMetaData(); String name=getMetaData.getColumnLabel(1); The name here is GAMETYPE, not GameType? Because I need to take the name to do the processing, but found that the name of the field defined by tale scheam is different. Seems to be all uppercase Do you have any additional settings to do? Can make String name=getMetaData.getColumnLabel(1); name will be the GameType Thank you -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/