Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how edit a connection profile
caribe
hello
I need to edit a connection profile (for the connection to the data source) or create one editable
the purpouse is to edit the parameters of the data source when I need (for many reports).
thanks for your help.
Find more posts tagged with
Comments
caribe
I change the question, I need a connection profile but like a file (editable), that function as a jar file or a library.
ashish13
<blockquote class='ipsBlockquote' data-author="'caribe'" data-cid="101661" data-time="1338854569" data-date="04 June 2012 - 05:02 PM"><p>
I change the question, I need a connection profile but like a file (editable), that function as a jar file or a library.<br /></p></blockquote>
<br />
Hi,<br />
<br />
You can set a default connection and while calling the report pass the connection which will override the default one. Is this you want?
caribe
yes I need that.. because I have many reports and if I need to chage the Data Source parameters, change only a file, no each connection.
thanks for you interest
ashish13
<blockquote class='ipsBlockquote' data-author="'caribe'" data-cid="101693" data-time="1338870229" data-date="04 June 2012 - 09:23 PM"><p>
yes I need that.. because I have many reports and if I need to chage the Data Source parameters, change only a file, no each connection. <br />
<br />
thanks for you interest<br /></p></blockquote>
<br />
Hi,<br />
<br />
If you are designing the report using API, you can set the data source by below code:<br />
<br />
OdaDataSourceHandle dsHandle = designFactory.newOdaDataSource("Data Source", "org.eclipse.birt.report.data.oda.jdbc" ); <br />
dsHandle.setProperty( "odaDriverClass","oracle.jdbc.driver.OracleDriver" ); <br />
dsHandle.setProperty( "odaURL", "jdbc:oracle:thin:
@<
;ip address>:<port>:TEST123" ); <br />
dsHandle.setProperty( "odaUser", "abcd" ); <br />
dsHandle.setProperty( "odaPassword", "start123" );<br />
designHandle.getDataSources( ).add( dsHandle ); <br />
<br />
and while accessing the report, you can rewrite the connection parameter by passing connection parameter using below code:<br />
<br />
IRunAndRenderTask task = null;<br />
design = engine.openReportDesign("C:/testSort.rptdesign"); <br />
task = engine.createRunAndRenderTask(design); <br />
Connection con = getConnection();<br />
task.getAppContext().put(IConnectionFactory.PASS_IN_CONNECTION, con);<br />
<br />
the con you can create either through JNDI or by other means.<br />
<br />
Hope this will be helpful to you.
caribe
thank you ashish13, you are very kind.
but can you guide me, I' newbie
the first code, I make a .jar file??
I don't want rewrite or pass the parameters in each connection, I only want a file with the Data source parameters, used by all reports. ^_^