Uploaded image for project: 'JDBC'
  1. JDBC
  2. JDBC-49

HPCCPreparedStatement does not allow Long or Integer types to be passed in as parameters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Fixed
    • Affects Version/s: 0.3.0
    • Fix Version/s: None
    • Component/s: Driver
    • Labels:
      None
    • Environment:
      Windows machine with java
      also a Unix VM with scala

      Description

      Running the following code...
      String myprepsql = "select k,s from ajp::temp::ds persons where k >= ? and k <= ?";
      HPCCPreparedStatement prepstmt = (HPCCPreparedStatement)connection.prepareStatement(myprepsql);
      prepstmt.setLong(1, (long)1);
      prepstmt.setLong(2, (long)5);
      HPCCResultSet qrs = (HPCCResultSet) ((HPCCPreparedStatement) prepstmt).executeQuery();
      while(qrs.next())

      { System.out.println(qrs.getInt("k")); }

      The following exception is presented...
      java.sql.SQLException: java.lang.Long cannot be cast to java.lang.String
      at org.hpccsystems.jdbcdriver.HPCCPreparedStatement.executeQuery(HPCCPreparedStatement.java:108)

      When looking at HPCCPreparedStatement, it looks like it tries to cast every parameter into a String.

        Attachments

          Activity

            People

            • Assignee:
              rpastrana Rodrigo Pastrana
              Reporter:
              apohl Aaron Pohl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: