-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Insertion de hibernate à MySQL
PostPosted: Fri May 13, 2005 5:28 am 
Newbie

Joined: Fri May 13, 2005 5:17 am
Posts: 2
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:

Bonjour,
J'ai intallé Hibernate avec Ecplipse et j'utilise une base MySQL. J'ai suivi les demarches decrite dans le site :
http://defaut.developpez.com/tutoriel/java/eclipse/hibernate/

Pour l'instant j'arrive à me connecté à la base et j'ai meme pu lire les tables que j'ai activé.

Le probleme est que : Quant j'essaye inserer un objet dans la base, le programme complie dans probleme mais, il se passe rien et j'ai toujour le triangle du warning.

Mon code est :

Code:
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();
}
}

et les derniers messages qui s'affichent à l'execution est :

Code:
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


merci pour votre aide

_________________
i m usinf Hibernate with Eclipse


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 5:40 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
peux tu montrer le fichier de mapping?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.