SQLException text is "Exception in thread "Data Type Mismatch16"
Run this code to reproduce the error:
import javax.sql.RowSet;
import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.RowSetMetaDataImpl;
import java.sql.Types;
public class F1 {
private static String cachedRowSetClass = "com.sun.rowset.CachedRowSetImpl";
public static void main(String[] args) throws Exception {
CachedRowSet rs = (CachedRowSet) Class.forName(cachedRowSetClass).newInstance();
initInstance(rs);
}
protected static void initInstance(CachedRowSet crs) throws Exception {
RowSetMetaDataImpl rsmdi = new RowSetMetaDataImpl();
crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
rsmdi.setColumnCount(1);
rsmdi.setColumnName(1, "_boolean_");
rsmdi.setColumnType(1, Types.BOOLEAN);
crs.setMetaData(rsmdi);
// ========== add a few rows
crs.moveToInsertRow();
crs.updateBoolean(1, false);
crs.insertRow();
}
}
Run this code to reproduce the error:
import javax.sql.RowSet;
import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.RowSetMetaDataImpl;
import java.sql.Types;
public class F1 {
private static String cachedRowSetClass = "com.sun.rowset.CachedRowSetImpl";
public static void main(String[] args) throws Exception {
CachedRowSet rs = (CachedRowSet) Class.forName(cachedRowSetClass).newInstance();
initInstance(rs);
}
protected static void initInstance(CachedRowSet crs) throws Exception {
RowSetMetaDataImpl rsmdi = new RowSetMetaDataImpl();
crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
rsmdi.setColumnCount(1);
rsmdi.setColumnName(1, "_boolean_");
rsmdi.setColumnType(1, Types.BOOLEAN);
crs.setMetaData(rsmdi);
// ========== add a few rows
crs.moveToInsertRow();
crs.updateBoolean(1, false);
crs.insertRow();
}
}