JDK-6462447 : select/update query sharing parameter throws ArrayIndexOutOfBoundException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.sql
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-08-22
  • Updated: 2011-02-16
  • Resolved: 2006-08-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6 b98Fixed
Code :

interface I_Query005 extends BaseQuery {
    @Select(sql="SELECT * from query005 where firstName=?1 and lastName=?1")
    DataSet<Player> getPlayer(String fName);

This select statement will not work and throw ArrayIndexOutOfBoundException as both parameters need to be initialized by same argument.

This is applicable for update statement as well.

SUGGESTED FIX The parameter type was not being set properly when two parameters share same argument. This issue will be fixed in this check-in. Check-in logs Checking in QueryObject.java; /m/jws/jdbc4.0/src/com/sun/sql/QueryObject.java,v <-- QueryObject.java new revision: 1.2; previous revision: 1.1 done

EVALUATION The method field's type need to be properly assigned when setting parameter value