[jboss-user] [JCA/JBoss] - Re: Implementing custom datasource

unnis do-not-reply at jboss.com
Mon May 19 01:32:02 EDT 2008


Dear adrian,

Thanks for the reply. My exact requirement is the following.

Based on the user profile I need to connect multiple databases. All of my databases will reside in same mysql server and is having same structure.I can't use multiple datasource and multiple connection pool, since the number of databses is more. So my plan is to have a single datasource and swich the database using setCatalog() jdbc method.

My application does the data source lookup in the following ways

1) Direct JNDI lookup in EJB
2) Using Hibernate
3) Using KODO-JDO

In all the above cases I am using same JNDI name ( mySqlDS) . 

How can I achive this ???

I feel that database switching has to be done before giving the connection to the client ( EJB/Hibernate/jdo) . So this has to be done at DataSource level so that ds.getConnection() should  return the proper connection with proper catalog set.


If I am using CustomDataSource , Inside CustomDataSource is there a way to access values from EJbContext ???

Thanks & Regards

unnis

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151648#4151648

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151648



More information about the jboss-user mailing list