if (rowset == null || !(rowset instanceof RowSet)) {
// rowset.33=Not a rowset
throw new SQLException(Messages.getString("rowset.33")); //$NON-NLS-1$
}
RowSet currentRs = (RowSet) rowset;
if (currentRs.getMetaData() == null) {
// rowset.32=The given rowset is empty
throw new SQLException(Messages.getString("rowset.32")); //$NON-NLS-1$
}
int matchCol = -1;
try {
if (rowset.getMatchColumnIndexes() != null
&& rowset.getMatchColumnIndexes().length > 0) {
matchCol = rowset.getMatchColumnIndexes()[0];
if (matchCol <= 0
|| matchCol > currentRs.getMetaData().getColumnCount()) {
matchCol = -2;
}
}
} catch (SQLException e) {
try {
if (rowset.getMatchColumnNames() != null
&& rowset.getMatchColumnNames().length > 0) {
try {
matchCol = currentRs.findColumn(rowset
.getMatchColumnNames()[0]);
} catch (SQLException e1) {
matchCol = -3;
}
}