Author: van.halbert
Date: 2011-07-01 15:17:29 -0400 (Fri, 01 Jul 2011)
New Revision: 3297
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
Log:
Added backward compatibility support so that pre JDBC 4, when using an 'Alias', it
will still be returned via the ResultSetMetadata.getColumnName. In JDBC 4, you will need
to call ResultSetMetadata.getColumnLabel. To enable backward support, add the
property: useJDBC4ColumnNameAndLabelSemantics=false to the url connection string.
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2011-07-01
19:17:03 UTC (rev 3296)
+++
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2011-07-01
19:17:29 UTC (rev 3297)
@@ -387,6 +387,10 @@
public Map<Integer, Object> getDefaultColumn(String tableName, String
columnName,
Class<?> javaType) {
+ return getDefaultColumn(tableName, columnName, columnName, javaType);
+ }
+
+ public Map<Integer, Object> getDefaultColumn(String tableName, String
columnName, String columnLabel, Class<?> javaType ) {
Map<Integer, Object> column = new HashMap<Integer, Object>();
@@ -395,7 +399,7 @@
column.put(ResultsMetadataConstants.VIRTUAL_DATABASE_VERSION, vdbVersion);
column.put(ResultsMetadataConstants.GROUP_NAME, tableName);
column.put(ResultsMetadataConstants.ELEMENT_NAME, columnName);
- column.put(ResultsMetadataConstants.ELEMENT_LABEL, columnName);
+ column.put(ResultsMetadataConstants.ELEMENT_LABEL, columnLabel);
column.put(ResultsMetadataConstants.AUTO_INCREMENTING, Boolean.FALSE);
column.put(ResultsMetadataConstants.CASE_SENSITIVE, Boolean.FALSE);
column.put(ResultsMetadataConstants.NULLABLE,
ResultsMetadataConstants.NULL_TYPES.NULLABLE);
Show replies by date