Closed GoogleCodeExporter closed 8 years ago
I was able to avoid the error by adjusting the log level. I am not sure which
one of these disabled the logging that was causing the problem (logback
configuration):
<logger name="jdbc.sqlonly" level="OFF"/>
<logger name="jdbc.sqltiming" level="OFF"/>
<logger name="jdbc.audit" level="OFF"/>
<logger name="jdbc.resultset" level="OFF"/>
<logger name="jdbc.resultsettable" level="OFF"/>
<logger name="jdbc.connection" level="OFF"/>
Original comment by j...@jarretttaylor.com
on 6 Oct 2011 at 8:05
Disabling the result set logging seems a bit drastic, since it is one of the
best features of this project. I have found another solution. The
colNameToColIndex field of DefaultResultSetCollector seems to contain only the
names of the columns, but the getXXX methods can also ask for column labels.
When replacing the following code:
private void setupColNameToColIndexMap() {
int columnCount = getColumnCount();
colNameToColIndex = new HashMap<String, Integer>(columnCount);
for (int column = 1; column <= columnCount; column++) {
colNameToColIndex.put(getColumnName(column).toLowerCase(), column);
}
}
with a more general
private void setupColNameToColIndexMap() {
int columnCount = getColumnCount();
colNameToColIndex = new HashMap<String, Integer>(columnCount);
for (int column = 1; column <= columnCount; column++) {
colNameToColIndex.put(getColumnName(column).toLowerCase(), column);
colNameToColIndex.put(getColumnLabel(column).toLowerCase(), column);
}
}
public String getColumnLabel(int column) {
try {
return metaData.getColumnLabel(column);
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
it works as expected.
Can anyone include this in the source and publish it to the maven repositories?
Original comment by betermi...@gmail.com
on 31 Oct 2011 at 12:10
I've added the fix from comment 2 and checked in to svn with some test code.
However its not in the maven repositroy yet
Original comment by tim.azzo...@gmail.com
on 7 Nov 2011 at 4:14
Original comment by tim.azzo...@gmail.com
on 7 Nov 2011 at 4:18
hopefully this is fixed now ! in version 0.2.5
Original comment by tim.azzo...@gmail.com
on 7 Nov 2011 at 10:52
Original issue reported on code.google.com by
castocol...@gmail.com
on 4 Apr 2011 at 6:49