-
Bug
-
Resolution: Fixed
-
P2
-
5.0
-
b97
-
generic
-
generic
The spec for public void JoinRowSet.addRowSet(Joinable rowset) says:
...
Throws:
java.sql.SQLException - if (1) an empty rowset is added to the to this JoinRowSet object,
...
In fact, java.sql.SQLException is thrown if rowset is empty. See an example below:
-------------------------------------------------------------------------------
import com.sun.rowset.CachedRowSetImpl;
import com.sun.rowset.JoinRowSetImpl;
import java.sql.SQLException;
import java.sql.Types;
import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.JoinRowSet;
import javax.sql.rowset.RowSetMetaDataImpl;
/**
*
* @author aag
*/
public class NewClass {
/** Creates a new instance of NewClass */
public static void main(String[] argv) throws SQLException {
JoinRowSet jrs = new JoinRowSetImpl();
CachedRowSet crs = new CachedRowSetImpl();
RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
rsmd.setColumnCount(1);
rsmd.setColumnName(1, "FIELD1");
rsmd.setColumnType(1, Types.INTEGER);
crs.setMetaData(rsmd);
try {
jrs.addRowSet(crs, 1);
System.out.println("SQLException was not thrown");
} catch (SQLException e) {
System.out.println("SQLException was thrown");
}
}
}
---------------------------------------------------------------------------
run-single:
SQLException was not thrown
...
Throws:
java.sql.SQLException - if (1) an empty rowset is added to the to this JoinRowSet object,
...
In fact, java.sql.SQLException is thrown if rowset is empty. See an example below:
-------------------------------------------------------------------------------
import com.sun.rowset.CachedRowSetImpl;
import com.sun.rowset.JoinRowSetImpl;
import java.sql.SQLException;
import java.sql.Types;
import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.JoinRowSet;
import javax.sql.rowset.RowSetMetaDataImpl;
/**
*
* @author aag
*/
public class NewClass {
/** Creates a new instance of NewClass */
public static void main(String[] argv) throws SQLException {
JoinRowSet jrs = new JoinRowSetImpl();
CachedRowSet crs = new CachedRowSetImpl();
RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
rsmd.setColumnCount(1);
rsmd.setColumnName(1, "FIELD1");
rsmd.setColumnType(1, Types.INTEGER);
crs.setMetaData(rsmd);
try {
jrs.addRowSet(crs, 1);
System.out.println("SQLException was not thrown");
} catch (SQLException e) {
System.out.println("SQLException was thrown");
}
}
}
---------------------------------------------------------------------------
run-single:
SQLException was not thrown