rowSetProps.setPropertyValue("DataSourceName", dbSourceName);
rowSetProps.setPropertyValue("Command", tableName);
rowSetProps.setPropertyValue("CommandType",
new Integer(CommandType.TABLE));
final XRowSet rowSet = UnoRuntime.queryInterface( XRowSet.class, m_rowSet);
rowSet.execute();
m_connection = UnoRuntime.queryInterface( XConnection.class, rowSetProps.getPropertyValue("ActiveConnection") );
XResultSet xRes = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
xRes.first();
log.println( "creating a new environment for object" );
TestEnvironment tEnv = new TestEnvironment( (XInterface)m_rowSet );
// Adding obj relation for XRowSetApproveBroadcaster test
{
final XResultSet resultSet = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
final XResultSetUpdate resultSetUpdate = UnoRuntime.queryInterface( XResultSetUpdate.class, m_rowSet );
final XRowUpdate rowUpdate = UnoRuntime.queryInterface(XRowUpdate.class, m_rowSet );
final PrintWriter logF = log ;
tEnv.addObjRelation( "XRowSetApproveBroadcaster.ApproveChecker",
new ifc.sdb._XRowSetApproveBroadcaster.RowSetApproveChecker()
{
public void moveCursor()
{
try
{
resultSet.beforeFirst();
resultSet.afterLast();
resultSet.first();
}
catch (com.sun.star.sdbc.SQLException e)
{
logF.println("### _XRowSetApproveBroadcaster.RowSetApproveChecker.moveCursor() :");
e.printStackTrace(logF);
throw new StatusException( "RowSetApproveChecker.moveCursor failed", e );
}
}
public RowChangeEvent changeRow()
{
try
{
resultSet.first();
rowUpdate.updateString(1, "ORowSetTest2");
resultSetUpdate.updateRow();
}
catch (com.sun.star.sdbc.SQLException e)
{
logF.println("### _XRowSetApproveBroadcaster.RowSetApproveChecker.changeRow() :");
e.printStackTrace(logF);
throw new StatusException( "RowSetApproveChecker.changeRow failed", e );
}
RowChangeEvent ev = new RowChangeEvent();
ev.Action = com.sun.star.sdb.RowChangeAction.UPDATE ;
ev.Rows = 1 ;
return ev ;
}
public void changeRowSet()
{
try
{
// since we gave the row set a parametrized statement, we need to ensure the
// parameter is actually filled, otherwise we would get an empty result set,
// which would imply some further tests failing
XParameters rowSetParams = UnoRuntime.queryInterface( XParameters.class, resultSet );
rowSetParams.setString( 1, "String2" );
rowSet.execute();
resultSet.first();
}
catch (com.sun.star.sdbc.SQLException e)
{
logF.println("### _XRowSetApproveBroadcaster.RowSetApproveChecker.changeRowSet() :");