Revision 28967 branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/jdbc/JDBCHelper.java
JDBCHelper.java | ||
---|---|---|
95 | 95 |
protected FromWKBGeometryOperationContext fromWKBContext = null; |
96 | 96 |
protected ToWKBOperationContext toWKBContext = new ToWKBOperationContext(); |
97 | 97 |
|
98 |
private Boolean allowAutomaticValues; |
|
98 |
private Boolean allowAutomaticValues = null; |
|
99 |
private Boolean supportsUnions = null; |
|
99 | 100 |
|
100 | 101 |
protected JDBCHelper(JDBCHelperUser consumer, |
101 | 102 |
JDBCConnectionParameters params) throws InitializeException { |
... | ... | |
1004 | 1005 |
} |
1005 | 1006 |
return allowAutomaticValues.booleanValue(); |
1006 | 1007 |
} |
1008 |
|
|
1009 |
public boolean supportsUnion() { |
|
1010 |
if (supportsUnions == null) { |
|
1011 |
ConnectionAction action = new ConnectionAction() { |
|
1012 |
|
|
1013 |
public Object action(Connection conn) throws DataException { |
|
1014 |
|
|
1015 |
try { |
|
1016 |
DatabaseMetaData meta = conn.getMetaData(); |
|
1017 |
return new Boolean(meta.supportsUnion()); |
|
1018 |
} catch (SQLException e) { |
|
1019 |
throw new JDBCSQLException(e); |
|
1020 |
} |
|
1021 |
} |
|
1022 |
|
|
1023 |
}; |
|
1024 |
|
|
1025 |
try { |
|
1026 |
supportsUnions = (Boolean) doConnectionAction(action); |
|
1027 |
} catch (Exception e) { |
|
1028 |
logger.error("Exception checking for unions support", e); |
|
1029 |
supportsUnions = Boolean.FALSE; |
|
1030 |
} |
|
1031 |
} |
|
1032 |
return supportsUnions.booleanValue(); |
|
1033 |
} |
|
1007 | 1034 |
} |
Also available in: Unified diff