[Datasource Configuration] - Error : configuring hibernate.cfg.xml dinamically
by Marco Leonardini
Marco Leonardini [https://community.jboss.org/people/thelostknight] created the discussion
"Error : configuring hibernate.cfg.xml dinamically"
To view the discussion, visit: https://community.jboss.org/message/774494#774494
--------------------------------------------------------------
hello
i have a problem when i try to configure the hibernate.cfg.xml dinamically
this is the HibernateUtil.java
Configuration cfg = new Configuration()
.addClass(Entidades.Empresa.class)
.addClass(Entidades.Persona.class)
.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/hibernate")
.setProperty("hibernate.connection.username", "admin")
.setProperty("hibernate.connection.password", "");
cfg.configure();
sessionFactory = cfg.buildSessionFactory();
and this is the hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_clapss">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/almacen</property>
<property name="hibernate.connection.username">xxx</property>
<property name="hibernate.connection.password">xxx</property>
<!--<mapping resource="Entidades/Persona.hbm.xml"/>
<mapping resource="Entidades/Empresa.hbm.xml"/>-->
</session-factory>
</hibernate-configuration>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/774494#774494]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months