Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
72:custom_reports_accessing_data_collecting_data [2019/02/07 14:06] – created ext-bkkr | 72:custom_reports_accessing_data_collecting_data [2024/02/15 00:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Collecting External Data ====== | ====== Collecting External Data ====== | ||
+ | |||
+ | ==== Connecting a JDBC Database via Stages Data Source ==== | ||
+ | |||
+ | The Java Database Connectivity (JDBC) API provides universal data access from the Java programming language. Using the JDBC 3.0 API, you can access virtually any data source, from relational databases to spreadsheets and flat files. JDBC technology also provides a common base on which tools and alternate interfaces can be built. | ||
+ | |||
+ | With the following script in a Stages dataset you can access the Stages mysql database on your local PC running Stages. | ||
+ | |||
+ | < | ||
+ | Class.forName(" | ||
+ | var url = " | ||
+ | con = DriverManager.getConnection( url, " | ||
+ | stmt = con.createStatement( | ||
+ | ResultSet.TYPE_SCROLL_SENSITIVE, | ||
+ | srs = stmt.executeQuery(" | ||
+ | while (srs.next()) { | ||
+ | dataset.setColumnValue(" | ||
+ | dataset.storeResultRow(); | ||
+ | } | ||
+ | srs.close(); | ||
+ | stmt.close(); | ||
+ | con.close(); | ||
+ | </ | ||
+ | |||
+ | The JDBC driver must be in the Stages classpath in | ||
+ | |||
+ | [install directory]\projectkit\tomcat\webapps\pkit\WEBINF\ platform\plugins \org.eclipse.birt.report.data.oda.jdbc_x.y.z\drivers | ||