}
// Adding relation for XResultSetUpdate
final XRowUpdate xRowUpdate = (XRowUpdate) UnoRuntime.queryInterface(
XRowUpdate.class, oObj);
final XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, oObj);
tEnv.addObjRelation("XResultSetUpdate.UpdateTester",
new ifc.sdbc._XResultSetUpdate.UpdateTester() {
String lastUpdate = null;
public int rowCount() throws SQLException {
int prevPos = xResSet.getRow();
xResSet.last();
int count = xResSet.getRow();
xResSet.absolute(prevPos);
return count;
}
public void update() throws SQLException {
lastUpdate = xRow.getString(1);
lastUpdate += "_";
xRowUpdate.updateString(1, lastUpdate);
}
public boolean wasUpdated() throws SQLException {
String getStr = xRow.getString(1);
return lastUpdate.equals(getStr);
}
public int currentRow() throws SQLException {
return xResSet.getRow();
}
});
// Adding relations for XRow as a Vector with all data
// of current row of RowSet.
Vector rowData = new Vector();
for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) {
rowData.add(DBTools.TST_TABLE_VALUES[0][i]);
}
tEnv.addObjRelation("CurrentRowData", rowData);
// Adding relation for XRowUpdate
XRow row = (XRow) UnoRuntime.queryInterface(XRow.class, oObj);
tEnv.addObjRelation("XRowUpdate.XRow", row);
return tEnv;
} // finish method getTestEnvironment