Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2684

getString from tinyint unsiged(255) column, throw exception: Numerica out of range

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1-incubating
    • None
    • client-jdbc-t4
    • None
    • centos:6.7,

    Description

      when i was using getString method on tinyint unsigned(255) column, throwed exception:
      Numerica out of range .

      test code as following:
      ####
      public void testGetString() throws SQLException {
      String tableName = "testGetString";

      try

      { Statement stmt = conn.createStatement(); stmt.executeUpdate("cqd traf_tinyint_return_values 'ON'"); stmt.executeUpdate("cqd traf_tinyint_input_params 'ON'"); stmt.executeUpdate("create table " + tableName + " (id int not null,age tinyint unsigned,primary key(id))"); stmt.executeUpdate("insert into " + tableName + " values(1,255)"); ResultSet rs = stmt.executeQuery("select * from " + tableName); rs.next(); System.out.println(rs.getString(2)); }

      finally

      { dropTable(tableName); }

      }
      ####

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              luoyunpeng luoyunpeng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: