Bug #5664 Excepcion en tiempo de ejecuciĆ³n
Submitted: 20 Sep 2004 12:40 Modified: 20 Sep 2004 14:17
Reporter: Emilio Olivares Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:mysql-connector-java-3.0.15-ga OS:Microsoft Windows (windows xp)
Assigned to: Mark Matthews CPU Architecture:Any

[20 Sep 2004 12:40] Emilio Olivares
Description:
ArrayIndexOfBoundsException
line 1805 of class PreparedStatement
line 1061 of class UpdatableResultset
where i insert a row and i use method updateByte("nameColumn", byte), this exception is generated.
where i update a row, this run correctly using the equal instruction.

How to repeat:
this code throw exception with insertRow(), not with updateRow();
    private void capturarCampos() throws SQLException {
        ResultSetMetaData rsmd = rs.getMetaData();
        String dato;
        String nombreCol;
        for(int i=1; i<=rsmd.getColumnCount(); i++) {
            dato = ((TextField)campos.get(rsmd.getColumnName(i))).getText();
            nombreCol = rsmd.getColumnName(i);
            switch (rsmd.getColumnType(i)) {
                case java.sql.Types.VARCHAR:
                     rs.updateString(nombreCol, dato); break;
                case java.sql.Types.SMALLINT:
                     rs.updateByte(nombreCol, Byte.parseByte(dato)); break;
            }
        }
    }
[20 Sep 2004 14:16] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[20 Sep 2004 14:17] Mark Matthews
The fix will be available in the nightly snapshot after 00:00 GMT this evening. See http://downloads.mysql.com/snapshots.php to test it.