ResultSet to RecordList correct way?


Hello guys,

I've got into some issues trying to use RuntimePublic.Db API, can some one provide some examples on how to do bulk inserts/record updates, queries and bulk deletions using an extension?

To contextualize lets imagine that I have the following entitiy linked to a logical table/view "", "ENCommandEntityRecord"  and his related structures/records/recordlists.

I instantiate both:
dbaProvider = DatabaseAccess.forRunningApplication();

sqlHelper = dbaProvider.getSqlHelper();

and create a:
cmd = requestTransaction.createCommand(<some sql string using sqlHelper for keywords>);

If I do some insert/delete operation I know I can use:
cmd.executeNonQuery() - and this is ok...

But if I want to query some table and get the resultset directly to a "RLCommandRecordList", how do I accomplish that in the correct way?
I've found something related, but I don't know if it's the correct way:
OSResultSet rs = cmd.executeReader();
RLCommandRecordList rl = new RLCommandRecordList();

Some examples for those operations would be nice.

Another question is if there is any possibility to adquire a dbConnection to run testcases in Eclipse instead of trying it in runtime in the dev environment.



Well, I've done some tests and it works this way:

public static ActGetDocument mosGetDocument(int inParamId) throws SQLException {
ActGetDocument result = new ActGetDocument();
result.outParamDocument = new RLDocumentRecordList();

DatabaseProvider dbaProvider = DatabaseAccess.forRunningApplication();
SqlHelper sqlHelper = dbaProvider.getSqlHelper();
RequestTransaction requestTransaction = dbaProvider.getRequestTransaction();
Command cmd = requestTransaction.createCommand();
String sql = String.format("SELECT * FROM osusr_m9y_document WHERE %s = %s",
cmd.createParameter(sqlHelper.prefixParam("id"), DBDataType.INTEGER.getIntValue(), inParamId);
try {
} catch (Exception e) {
return result;

Just a note, I'm working on Bali version (9.1) and in this version DbType class doesn't exist, I had to use DBDataType.

Best Regards,


I'm still missing a way to adquire a dbConnection to run testcases in Eclipse instead of trying it in runtime in the dev environment, any suggestions?