Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hello,
i'm using Hibernate and Eclipse with MySQL Database. I could connect the database and dislpay some fields from certain tables.
But the probleme is when i try to insert an object into a table, i use the following program. I have no errors but the warning signal persists, and nothing happen in the database.
So, the program that i wrote is :
import java.util.*;
import net.sf.hibernate.*;
import com.minosis.hibernate.*;
public class Insertion {
public static void main(String[] args)
throws HibernateException {
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
Equipement Equipemen = new Equipement();
short id=2;
short local = 11;
Equipemen.setId(new Short(id));
Equipemen.setNom("Dupont");
Equipemen.setModele("tototo");
Equipemen.setLocal(new Short(local));
session.save(Equipemen);
tx.commit();
HibernateUtil.closeSession();
}
}
and When i execute i ve as lasts messages :
13 mai 2005 11:12:16 net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
13 mai 2005 11:12:17 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Thank u for your help
Regards