try {
ResultSet rs = this.schema.getColumns(null, column.schemaName(),
column.tableName(), column.attributeName());
try {
if (!rs.next()) {
throw new D2RQException("Column " + column + " not found in database",
D2RQException.SQL_COLUMN_NOT_FOUND);
}
int type = rs.getInt("DATA_TYPE");
String name = rs.getString("TYPE_NAME").toUpperCase();
int size = rs.getInt("COLUMN_SIZE");
DataType result = db.vendor().getDataType(type, name, size);
if (result == null) {
log.warn("Unknown datatype '" + (size == 0 ? name : (name + "(" + size + ")")) + "' (" + type + ")");
}
return result;
} finally {
rs.close();
}
} catch (SQLException ex) {
throw new D2RQException("Database exception", ex, D2RQException.D2RQ_SQLEXCEPTION);
}
}