There seems to be a bug or at least an unexpected behaviour when using the UCanAccess JDBC-driver. Is there an explanation or is it just a bug that should be fixed?
Here is a simple example:
ResultSet rs = statement.executeQuery("SELECT name, name n, name as n2 FROM Person");
ResultSetMetaData metaData = rs.getMetaData();
System.out.println(metaData.getColumnLabel(1));
System.out.println(metaData.getColumnLabel(2));
System.out.println(metaData.getColumnLabel(3));
The result is:
name
name
n2
Shouldn't the second row be "n" instead of "name"? The use of the optional keyword AS should not have this kind of effect.
And then there is another strange behaviour with the aliases getting capitalized. Same example, with this slightly modified SQL statement:
ResultSet rs = statement.executeQuery("SELECT * FROM (SELECT name, name n, name as n2 FROM Person)");
ResultSetMetaData metaData = rs.getMetaData();
System.out.println(metaData.getColumnLabel(1));
System.out.println(metaData.getColumnLabel(2));
System.out.println(metaData.getColumnLabel(3));
Now the result becomes
NAME
N
N2
Not a big problem, but quite unexpected to see all the column labels capitalized.
Any good explanations as to the reasons for these behaviours?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This was originally asked at stackoverflow according to the instructions on https://ucanaccess.sourceforge.net/site.html#about but never got answered. I am trying here.
There seems to be a bug or at least an unexpected behaviour when using the UCanAccess JDBC-driver. Is there an explanation or is it just a bug that should be fixed?
Here is a simple example:
The result is:
Shouldn't the second row be "n" instead of "name"? The use of the optional keyword AS should not have this kind of effect.
And then there is another strange behaviour with the aliases getting capitalized. Same example, with this slightly modified SQL statement:
Now the result becomes
Not a big problem, but quite unexpected to see all the column labels capitalized.
Any good explanations as to the reasons for these behaviours?