postgresql - Dynamic hibernate connection -


we developing jsf app connecting existing postgresql db using hibernate. each of our clients have own postgresql data base. possible host 1 app dynamically connecting databases based on client users login ( each client have 1 postgresql db) .

for development using 1 client & pojo access hibernate.cfg.xml , need change take multiple clients.

  <property name='hibernate.connection.driver_class'>org.postgresql.driver</property>   <property   name='hibernate.connection.url'>jdbc:postgresql://testdev01/test_client</property>   <property name='hibernate.connection.username'>username</property>   <property name='hibernate.connection.password'>password</property>   <property name='hibernate.connection.pool_size'>10</property>   <property name='show_sql'>true</property>   <property name='dialect'>org.hibernate.dialect.postgresqldialect</property> 

you can create sessionfactory programatically, see this: http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html, instance. once client logged in you, can create separate sessionfactory client database.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -