@@ -0,0 +1,892 @@
+package sfBugs;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0A%0Apublic class Bug1006704 %7B%0A    void f(Connection con, Integer key) throws SQLException %7B%0A        StringBuffer sql = new StringBuffer(%22SELECT * FROM xxx  WHERE xxx_id = ?%22);%0A        PreparedStatement ps = con.prepareStatement(sql.toString());%0A        try %7B%0A            ps.setInt(1, key.intValue());%0A            ResultSet rs = ps.executeQuery();%0A            try %7B%0A                rs.next();%0A                int index = 1;%0A                Integer firstQuestionId = new Integer(rs.getInt(index++));%0A                String description = rs.getString(index++);%0A                Float approvalScore = new Float(rs.getFloat(index++));%0A            %7D finally %7B%0A                rs.close();%0A            %7D%0A        %7D finally %7B%0A            ps.close();%0A        %7D%0A%0A    %7D%0A%7D%0A

Add sourceforge testcase