DATASOURCE FOR MULTIPLE CLIENT INSTANCE

HI Folks,

I would like to know how to achieve accessing /creating  making a datasource for my web applications different db instance.

Let me tell  what i have done so far.

1. I have a php web application and intergrated jasperserver successfully, in jasperserver  i used to create datasource say ' clientA_db'  with appropriate db name correctly, and will upload jrxml in jasperserver ,will point datasource for the uploading jrxml to 'clientA_db' .

 

My requirment is we have a different clients db with same web application jasperserver webservice intergrated ( i.e multi -tenant) .

as per my first point, we able to setup jasperserver thing for 'clientA'  , if we plan to access same jasperserver db for 'clientB' ,where the datasource already been created with the name of the 'clientA_db' means, how we should dynamically change datasource name to apporiate client instance database.

is there any way to dynamically setup datasource via webservice as a parameter .?

how we need to make it ?

pl.anyone guide me how to achive this ?

thanks,

teamireport

 

 

 

 

 

teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

15 Answers:

If you are using a multi-tenant setup, would it work if you just setup different datasources in each organization?

org1/datasource/somedatasource

org2/datasource/someotherdatasource

The datasources could have same/different names and attributes as they would exist in separate organizations.

I am sort of confused by your question when you say that you will access the same jasperserver db for both applications.  Are you talking about the repository database here? 

 

jdevine's picture
209
Joined: Oct 14 2009 - 8:20am
Last seen: 13 years 7 months ago

Thanks for your quick suggestion ,

 

snip>>

I am sort of confused by your question when you say that you will access the same jasperserver db for both applications.  Are you talking about the repository database here?

 yes, i'm talking about repository database, there we hardcorde database name for the 'clientA ' in datasource . this would be like

repository jasperserver database which contains jrxml ,which always looks for 'clientA' database for all my report, since i have created datasource for 'clientA' alone, if we setup 'clientB' instance , the same jasperserver only looks for 'clientA' db,not 'clientB' here how do i change databasename in datasource of jasperserver dyanmcially for clientB .

client  A < ----- >jasperserver db(where hardcoded database name for 'clientA' instance alone)  <---->clientB

                                                           



Post Edited by teamireport at 12/09/2009 18:18
teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

OK, but when you said multi-tenant, I assumed that clientA & clientB would be in different organizations.  Are you saying that clientA & clientB should be DS's in the same organization and configured to point to different DB's (and then you want your reports to be able to run against either)?

If so, I think I better understand the question (but multi-tenant doesn't seem relevant to this discussion).

jdevine's picture
209
Joined: Oct 14 2009 - 8:20am
Last seen: 13 years 7 months ago

Thank you so much for understanding my question.

 

Yes, i want my reports to be configure  and to run in both datasources .

teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

OK, now I understand, but I am not sure of the solution.

One solution would be to deploy the reports to 2 different organizations and then define different datasources in each organization.  Your app would then require multiple web service clients (to point at the multiple organizations).

Another potential solution would be to write a custom data source.  I've only implemented a custom data source that reads the connection information from a properties file, but you may be able to write it in such a way that it creates a connection based on some input parameter passed into the report (your DAO should have access to the report params).

Take a look at section 5.10 of the JasperServer-Pro-Admin-Guide.pdf. (see 5.10.5 for details). 

jdevine's picture
209
Joined: Oct 14 2009 - 8:20am
Last seen: 13 years 7 months ago

Many thanks jdevine for your support.

 

yes, solution # 1 that you mentioned ,i already had in my mind, going by solution #1 apporach what we feel means, if any changes made in organization 1 jrxml means , need to do the same in organzation 2 too without forgetting :) , we feel this apporach is fine but moving forward in future maintaining the repository db is quite hetic.so, i was looking forwards for other solution.

 

But, yours solution #2 is quite impressive and that giving me confident to achive.

let me go thru the doc in few mintues ,will get back to you,

BTW, could you pl. able to attach custom data source that you have created, that surely gives me some insight. ?



Post Edited by teamireport at 12/09/2009 18:46
teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

jasperserver (version 3.5.1) ships with some complete examples (see samples\\customDataSource).

This gives an end-to-end solution as it contains jrxml, the java implementation, and the required WEB-INF files.

jdevine's picture
209
Joined: Oct 14 2009 - 8:20am
Last seen: 13 years 7 months ago

yes, i have found the custom datasource example files as you mentioned,  thanks ton !

but i dont find the doc "JasperServer-Pro-Admin-Guide.pdf "  :(

 

could you pl. tell me where its available ? i have searched my whole  jasperserver checkout directory

could you please ?

 

teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

I am running jasperserver-pro-3.5.1 & I am not sure if you are running the same.

There should be a folder called docs on the same level as samples...otherwise just search for *.pdf

jdevine's picture
209
Joined: Oct 14 2009 - 8:20am
Last seen: 13 years 7 months ago

 

Yup ! my bad , i'm using jasperserver community edition,

i found the doc from jasperserver -pro which is been installed in another machine.

let me go thru the doc right away



Post Edited by teamireport at 12/09/2009 19:09
teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

Yup my bad ! i was searching in the jasperserver communtiy edition folder level.

now i found the doc from jasperserver-pro . :)

 

teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago
sorry double post
teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

jdevine ! thanks you so much for your time that you spent for  replying to my qns sooner.

i looked at the doc ,getting some ideas that you already mentioned.

let me start doing implementing the custom datasource, if i have questions or somewhere i struggle will let u know.

could you please keep watching this forum continuosly, ? i post my updated here,so that other users can benefit from our conversation

once again many thanks...bye for now will catch you by tommrow.

 

 

teamireport's picture
Joined: Apr 18 2009 - 3:43am
Last seen: 14 years 1 month ago

 Hi there,

Did you get the solution working with a custom datasource? I am looking for a similar solution too so any info/help will be appreciated.

Cheer

revolutionizeit's picture
Joined: Sep 24 2011 - 4:01pm
Last seen: 11 years 8 months ago

Hi,

can somebody post solution for this using custom data source.

thanks

naikrish94's picture
Joined: Oct 12 2017 - 9:49pm
Last seen: 5 years 5 months ago
Feedback
randomness