-
1. Re: Is it possible to connect at multiples databases ???
galderz Jan 4, 2006 3:14 PM (in response to boby)are you accessing the database via entity beans?
-
2. Re: Is it possible to connect at multiples databases ???
boby Jan 5, 2006 2:45 AM (in response to boby)I access the database with the Entity Manager like this :
@PersistenceContext(unitName = "jobs")
protected EntityManager em;
public Collection<T_Jobs> getJobs() {
return em.createQuery("from T_Jobs").getResultList();
}
for example to retrieve the jobs, but Id like to do that on the database which I want.
I think at a solution, but I have to create a file -ds.xml fro each database (hence for each client). Then I have to write the list of -ds.xml file in my persistence.xml file.
I would have a number of fix database, that would be great, but that changes everytyme. Therefore, I have to find a best mean. -
3. Re: Is it possible to connect at multiples databases ???
galderz Jan 6, 2006 9:55 AM (in response to boby)a datasource file (ds.xml) can contain references to multiple databases/datasources.
jboss-dtd_1_5.dtd:
<!ELEMENT datasources (mbean | local-tx-datasource | xa-datasource | no-tx-datasource | ha-local-tx-datasource | ha-xa-datasource)*>
you would need to link each to client to each datasource.
hope this helps :-D -
4. Re: Is it possible to connect at multiples databases ???
boby Jan 9, 2006 9:36 AM (in response to boby)I know it, thanks anyway. :=)
Im trying to implement the ConnectionProvider interface Hibernate for using my connection pool with my databases. I have to know now how to update dynamically the entityManager with my ConnectionProvider. I cant use the @PersistanceContext annotation, I think.
Im going to look at this.
Thanks.