jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vlsi <...@git.apache.org>
Subject [GitHub] jmeter pull request: Use typed methods such as setInt, setDouble, ...
Date Mon, 24 Aug 2015 23:00:11 GMT
Github user vlsi commented on a diff in the pull request:

    https://github.com/apache/jmeter/pull/27#discussion_r37815468
  
    --- Diff: src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
---
    @@ -338,6 +328,44 @@ private static final int countRows(ResultSet resultSet) throws SQLException
{
             return outputs;
         }
     
    +    private void setArgument(PreparedStatement pstmt, String argument, int targetSqlType,
int index) throws SQLException {
    +        switch (targetSqlType) {
    +        case Types.INTEGER:
    +            pstmt.setInt(index, Integer.parseInt(argument));
    +            break;
    +        case Types.DOUBLE:
    +        case Types.DECIMAL:
    +            pstmt.setDouble(index, Double.parseDouble(argument));
    --- End diff --
    
    This is not valid.
    
    >https://docs.oracle.com/javase/1.5.0/docs/guide/jdbc/getstart/mapping.html
    >The recommended Java mapping for the DECIMAL and NUMERIC types is java.math.BigDecimal


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message