[ http://issues.apache.org/jira/browse/DERBY-2104?page=comments#action_12454029 ] Daniel John Debrunner commented on DERBY-2104: ----------------------------------------------
> The problem is that calling the getString method on the CHAR column returns > "\u10bb" while calling the same method on the BINARY column returns a String > with the hexadecimal representation of the byte array "10bb". I think this is the documented behaviour. See the clarifications for getString() in: http://db.apache.org/derby/javadoc/publishedapi/jdbc3/org/apache/derby/jdbc/package-summary.html#implresultset > Embedded - Column of type CHAR, VARCHAR or LONG VARCHAR contains wrong value > after being updated using the ResultSet.updateBytes() method. > ------------------------------------------------------------------------------------------------------------------------------------------ > > Key: DERBY-2104 > URL: http://issues.apache.org/jira/browse/DERBY-2104 > Project: Derby > Issue Type: Bug > Components: JDBC > Reporter: Fernanda Pizzorno > > REPRO: > Statement stmt1 = > conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, > ResultSet.CONCUR_UPDATABLE); > > stmt1.executeUpdate("CREATE TABLE t1 (i int, c char(60))"); > stmt1.executeUpdate("INSERT INTO t1 values (1, 'xx')"); > > ResultSet rs1 = stmt1.executeQuery("SELECT * FROM t1"); > > if (!rs1.next()) { > System.out.println("Row not found"); > return; > } > > rs1.updateBytes(2, "NEW VALUE".getBytes()); > rs1.updateRow(); > rs1.close(); > > rs1 = stmt1.executeQuery("SELECT * FROM t1"); > if (!rs1.next()) { > System.out.println("Row not found"); > return; > } > > if (!rs1.getString(2).equals("NEW VALUE")) { > System.out.println("FAIL - wrong string value for column 2. " > + > "Expected: NEW VALUE but was: " + rs1.getString(2)); > } > OUTPUT: > FAIL - wrong string value for column 2. Expected: NEW VALUE but was: ????? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
