lookup datasource in context every time, Is it right?

Posted by Srikanth Dyapa on Stack Overflow See other posts from Stack Overflow or by Srikanth Dyapa
Published on 2011-06-24T07:06:16Z Indexed on 2011/06/24 8:22 UTC
Read the original article Hit count: 146

Filed under:
|
|

In my application i configured more than one datasource (for diff databases). Whenever user sends a request depends upon user category i need to look up for the respective datasource in the context and get a connection from that datasource to execute queries which are assigned to that user. Is it right way to achieve my requirement? I am using tomcat 6, struts 1.3. The databases may be oracle or mysql or both.

Give me an optimized solution.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about datasource