#1 2020-10-14 18:32:50

unsi_2
Member
Registered: 2020-06-24
Posts: 11

access datasource from script

Hi
i need a script (not a report) to connect to a database table, for using that data.

is there a built in object to obtain an existing datasource?
or have to be made using jdbc and setting the url connection?


kind regards

Offline

#2 2020-10-15 07:41:40

eduardo
Administrator
Registered: 2016-11-01
Posts: 1,789
Website

Re: access datasource from script

Hi unsi_2,

you can access an existing datasource directly via script using the "connection" object, pls take a look here:
https://reportserver.net/en/tutorials/t … scripting/

If you don't create a script report, but you need a plain script, you can use groovy sql's constructs to connect to any database: https://docs.groovy-lang.org/latest/htm … l/Sql.html
or you can use plain JDBC calls too.

You can also get a datasource via DataSource Service: net.datenwerke.rs.core.service.datasourcemanager.DatasourceService.getDatasourceByName(String)
Pls check the services list in the API, available in the sourceforge downloads: https://sourceforge.net/projects/dw-rs/files/

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB