mysql « cfg « JPA Q&A

1. hibernate.cfg.xml contains info about MySQL database they why I am getting this exception?

This is question about java hibernate. my hibernate.cfg.xml is

 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "">
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>

2. how can I change the properties of the cfg.xml file?

I'm trying to change the properties of the hibernate.cfg.xml file programmatically here's what I did :

public class NewHibernateUtil {

 private final SessionFactory sessionFactory;
 String host;
 String database;
 String username;
 String password;
 NewHibernateUtil(String ...

3. optimum configuration for mysql (hibernate.cfg.xml)

my configuration look like below, but when i monually go to mysql front and modify a record inside a table and follow by use hibernate to retrive the record, i still get old "record" . the record from hibernate query seem to be inconsistent . can someone post an optimum configuration for mysql? I already use the property 2 but ...