BIRT Exchange Forum: Dynamically change Data Source - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Dynamically change Data Source Rate Topic: -----

#1 User is offline   MarkW Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 35
  • Joined: 03-April 11


Posted 08 April 2011 - 04:47 PM

How can I change the data source using the engine API?
0

#2 User is offline   blagerweij Icon

  • Junior Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 28-June 09


Posted 08 February 2012 - 03:39 PM

View PostMarkW, on 08 April 2011 - 04:47 PM, said:

How can I change the data source using the engine API?


Here is what we use:

        Source[] sources = document.getBook().getDataSourceCollection().get();
        for (Source source : sources) {
            if (source instanceof JDBC) {
                JDBC jdbc = (JDBC) source;
                jdbc.set(jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword, false);
            }
        }



Note: using JNDI does not seem to work, nor are we able to inject a JDBC Connection directly. However, specifying driver, url, username and password works.

With kind regards,

Barry Lagerweij
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users