Skip to content

Commit

Permalink
ignore missing columns when parsing result
Browse files Browse the repository at this point in the history
  • Loading branch information
aardouin committed Aug 31, 2016
1 parent 05ed7cb commit 573d20d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/org/orman/dbms/ResultList.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ private ResultRow(Map<String, Integer> columnNameMap, Object[] row) {
}

public Object getColumn(String columnName) {
return row[columnNameMap.get(columnName)]; // TODO if column does not exist throw xceptn
if( columnNameMap.get(columnName) != null){
return row[columnNameMap.get(columnName)]; // TODO if column does not exist throw xceptn
}else{
System.out.println("Missing column : " + columnName + "ignoring column");
return null;
}
}
}

/**
* Initializes columnNames with given record array.
*
Expand Down

0 comments on commit 573d20d

Please sign in to comment.