@Karina,
Crie um dataset com esse exemplo abaixo, dai você muda a query:
function createDataset(fields, constraints, sortFields) {
log.info("#### DS TESTE ####");
var newDataset = DatasetBuilder.newDataset();
var ic = new javax.naming.InitialContext();
var created = false;
var query = '';
var filtro = '';
var banco = '';
var zoom = 0;
var dataSource = "jdbc/FluigDS";
if(constraints != null) {
if(constraints.length > 0) {
for (var i = 0; i < constraints.length; i++) {
}
}
}
query = "UPDATE fdn_usertenant SET USER_COD = 'nova_matricula' WHERE USER_COD = 'matricula'";
log.info("#### QUERY ####");
log.info(query);
var ds = ic.lookup(dataSource);
try {
var conn = ds.getConnection();
var stmt = conn.createStatement();
var rs = stmt.executeUpdate(query); // função que executa o update no banco
var columnCount = rs.getMetaData().getColumnCount();
while(rs.next()) {
if(!created) {
for(var i = 1; i <= columnCount; i++) {
newDataset.addColumn(rs.getMetaData().getColumnName(i));
}
created = true;
}
var Arr = new Array();
for(var i = 1; i <= columnCount; i++) {
var obj = rs.getObject(rs.getMetaData().getColumnName(i));
if(null!=obj) {
Arr[i-1] = rs.getObject(rs.getMetaData().getColumnName(i)).toString();
} else {
Arr[i-1] = "null";
}
}
newDataset.addRow(Arr);
}
} catch(e) {
log.info("ERRO ==============> " + e.message);
newDataset.addColumn("ERRO");
newDataset.addRow(new Array(e.message));
} finally {
if(stmt != null) stmt.close();
if(conn != null) conn.close();
}
return newDataset;
}