Name: sdR10048 Date: 06/24/2003
Filed By : SPB JCK team (###@###.###)
JDK : This JSR is not yet in JDK 1.5
JCK : 1.5
Platform[s] : Solaris
switch/Mode :
JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
Failing Test [s] : N/A
Specification excerpt:
======================
--------- J2SE API spec v.1.5 ---------
...
public void setDate(int parameterIndex,
java.sql.Date x)
throws java.sql.SQLException
Sets the designated parameter to the given java.sql.Date value. The driver converts this to an SQL DATE value when it sends it to the database.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this rowset's command when the method execute is called.
Primitives and object instances values to be used as rowset command parameters are stored internally as object instances in an internal Vector object instance. Subsequent calls to getParams ouput an object array of the current command parameters that is a direct representation of the current internal command parameters.
Parameters:
parameterIndex - the index into this rowset object's internal representation of parameter values; the first parameter is 1, the second is 2, and so on; must be 1 or greater
x - the parameter value
Throws:
java.sql.SQLException - if an error occurs or the parameter index is out of bounds
===================
public void setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
throws java.sql.SQLException
Sets the designated parameter to the given java.sql.Date object. The driver converts this to an SQL DATE value when it sends it to the database.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this rowset's command when the method execute is called.
Primitives and object instances values to be used as rowset command parameters are stored internally as object instances in an internal Vector object instance. Subsequent calls to getParams ouput an object array of the current command parameters that is a direct representation of the current internal command parameters.
=====================
ublic java.lang.Object[] getParams()
throws java.sql.SQLException
Retrieves an array containing the parameters that may be set in the PreparedStatement object that is the command for this rowset.
Returns:
an array of Object values, which are the parameters that may be set in this rowset's command
...
---------- end-of-excerpt ---------------
Problem description
===================
For javax.sql.rowset.BaseRowSet methods:
setNull(int, int)
setNull(int, int, String)
setDate(int, Date)
setDate(int, Date, Calendar)
setTimestamp(int, Timestamp)
setTimestamp(int, Timestamp, Calendar)
setObject(int, Object)
setObject(int, Object, int)
setObject(int, Object, int, int)
setAsciiStream
setBinaryStream
setCharacterStream
setUnicodeStream
it is unspecified what will be the getParams() output after this
methods call.
And it is also unspecified what will be the difference between
getParams() outputS in say setNull(int, int, String) and (setNull(int,
int) cases. Or in case of setDate(int, Date) and setDate(int, Date, Calendar) pair;
The difference SHOULD BE since there is extra parameter.
This story's with pairs:
setNull(int, int) & setNull(int, int, int)
setDate(int, Date) & setDate(int, Date, Calendar)
setTimestamp(int, Timestamp) & setTimestamp(int, Timestamp, Calendar)
setObject(int, Object) & setObject(int, Object, int) & setObject(int, Object, int, int)
(the triplet)
Some extra details for setXXX problem:
(can be applied for other pairs)
======================================
1) if I call setCommand("SELECT ? FROM MYTABLE")
2) and if then I call setNull(1, java.sql.Types.DATE)
3) and then I call getParams()
- what will be the output?
a) {null} <-wrong since I've specified extra int
b) something else
And details about the twin: setNull(int, int, String)
(one extra parameter)
1) if I call setCommand("SELECT ? FROM MYTABLE") for example
2) and if then I call setNull(1, java.sql.Types.STRUCT, "My")
3) and then I call getParams()
- what will be the output?
a) {null} <-wrong since I've specified extra int and String
The second setNull seems useless then.
The second and the third parameters are needless
since we do not make any difference in getParams().
b) something else
- and what will be the difference with the previous case?
Some extra details for setXXXStream problem:
============================================
1) if I call setCommand("SELECT ? FROM MYTABLE") for example
2) and if then I call setAsciiStream(1, inputStream, 10)
3) and then I call getParams()
- what will be the output?
a) {inputStream} ? That is wront since I've specified 10
bytes parameter
b) {{inputStream, 10}} ? As your implementation does
c) something else ?
================================
I want to remind that all comments/changes should be reflected in
javadoc.
See http://java.sun.com/j2se/javadoc/writingapispecs/index.html#method for more information.
======================================================================