Skip to content

Commit

Permalink
moidfy getDecimal by DecimalData.fromBigDecimal(bigDecimal, precision…
Browse files Browse the repository at this point in the history
…, scale)
  • Loading branch information
baisui1981 committed Jul 29, 2022
1 parent 332f0b8 commit 2251bcf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,12 @@ protected void executeQuery(String startLocation) throws SQLException {
state = startLocation;
}
} else {
statement = dbConn.createStatement(resultSetType, resultSetConcurrency);
statement.setFetchSize(jdbcConf.getFetchSize());
statement.setQueryTimeout(jdbcConf.getQueryTimeOut());
resultSet = statement.executeQuery(jdbcConf.getQuerySql());
hasNext = resultSet.next();
// statement = dbConn.createStatement(resultSetType, resultSetConcurrency);
// statement.setFetchSize(jdbcConf.getFetchSize());
// statement.setQueryTimeout(jdbcConf.getQueryTimeOut());
// resultSet = statement.executeQuery(jdbcConf.getQuerySql());
// hasNext = resultSet.next();
throw new UnsupportedOperationException("must be polling");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,13 @@ public StringData getString(int pos) {

@Override
public DecimalData getDecimal(int pos, int precision, int scale) {
BigDecimal bigDecimal = this.columnList.get(pos).asBigDecimal();
return DecimalData.fromBigDecimal(bigDecimal, bigDecimal.precision(), bigDecimal.scale());

// baisui modify 2022/07/29
AbstractBaseColumn col = this.columnList.get(pos);
BigDecimal bigDecimal = (BigDecimal) col.getData();
// =this.columnList.get(pos).asBigDecimal();
// return DecimalData.fromBigDecimal(bigDecimal, bigDecimal.precision(), bigDecimal.scale());
return DecimalData.fromBigDecimal(bigDecimal, precision, scale);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ public String asTimestampStr() {

@Override
public Integer asInt() {
throw new CastException("java.sql.Time", "Integer", this.asString());
// throw new CastException("java.sql.Time", "Integer", this.asString());

Time time = asTime();
if (time == null) {
return null;
}
return (int) time.getTime();
}

@Override
Expand Down

0 comments on commit 2251bcf

Please sign in to comment.