One possibility is the usage of the RowSet service. This possibility is not as advanced as using the statement object.
/* get the service manager */
xContext = UNO.connect()
xMcf = xContext~getServiceManager
/* create RowSet object */
xRowSet = xMcf~createInstanceWithContext(-
"{%see com.sun.star.sdb.RowSet}",xContext)~{%see com.sun.star.sdbc.XRowSet%XRowSet}
say "RowSet created!"
/* set the properties which are needed to connect to a database */
xPropertySet = xRowSet~{%see com.sun.star.beans.XPropertySet%XPropertySet}
xPropertySet~setPropertyValue("DataSourceName", "mysql-test")
xPropertySet~setPropertyValue("User", "stefan")
xPropertySet~setPropertyValue("Password", "apple")
/* choose the CommandType TABLE and set the command */
xPropertySet~setPropertyValue("Command", "test.sales")
xPropertySet~setPropertyValue("CommandType", box(-
"int",bsf.getStaticValue("{%see com.sun.star.sdb.CommandType}", "TABLE")))
/* now execute the previous specified command */
xRowSet~execute
say "RowSet executed!"
/* process the ResultSet */
say "Results:"
xRow = xRowSet~{%see com.sun.star.sdbc.XRow%XRow}
DO WHILE xRowSet~next <> .false
name = xRow~getString(1)
price = xRow~getString(2)
price2 = xRow~getString(3)
say name"-"price"-"price2
END
say
say "---Infos---"
/* show amount of returned rows*/
say "There are:" xPropertySet~getPropertyValue("RowCount") "rows"
/* show the currently used command */
say "Used Command:" xPropertySet~getPropertyValue("ActiveCommand")
say "-----------"
say
/* destroy the created RowSet */
xComp = xRowSet~{%see com.sun.star.lang.XComponent%XComponent}~dispose
say "RowSet destroyed!"
::requires UNO.cls -- get UNO support