Hi There,
Not sure if you can do it with hibernate.cfg.xml but surly in your hibernate utility class while creating sessionfactory, something like below
Code:
Configuration configuration = new Configuration();
configuration.setProperty( "hibernate.connection.datasource", "java:/jdbc/" + dsName );
sessionFactory = configuration.configure( new File( configFile ) ) .buildSessionFactory();
hmSessionFactory.put(dsName,sessionFactory);
.....
....
you will have to maintain hashmap of sessionfactory that will have key as dsname and value of respective session factory.
just wondering what exactly is your requirement.
-Praful