Results 1 to 2 of 2
  1. #1
    wassimbik is offline Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0

    Default Problème avec session

    Hello all

    I have a problem with hibernate: I have installed Hibernate3 hibernate2 and I import them.But the problem persists at the session.

    My java code:

    import net.*;
    import org.*;
    import com.*;
    import java.util.*;
    import net.sf.hibernate.*;
    import com.test.java.hibernate.*;

    public class Test{
    public static void main(String[]args) throws HibernateException{
    //The method beginTransaction() is undefined for the type Session
    Session session=HibernateUtil.currentSession();
    Transaction tx=session.beginTransaction();
    TContact contact= new TContact();
    contact.setNom("Dupont");
    contact.setPrenom("Jean");
    contact.setAge(new Integer(44));
    session.save(contact);
    contact= new TContact();
    contact.setNom("Lambert");
    contact.setPrenom("Julie");
    contact.setAge(new Integer(27));
    session.save(contact);
    tx.commit();
    HibernateUtil.closeSession();

    }
    }
    Last edited by wassimbik; 07-22-2010 at 12:24 PM.

  2. #2
    arun9683 is offline Member
    Join Date
    Jun 2010
    Location
    Bangalore,India
    Posts
    70
    Rep Power
    0

    Default

    Please can you put your question in english ?
    Arun K R,Bangalore,India
    :)

Similar Threads

  1. Problème avec Hibernate
    By wassimbik in forum JDBC
    Replies: 0
    Last Post: 07-22-2010, 11:23 AM
  2. probleme with my code
    By yacin87 in forum Networking
    Replies: 0
    Last Post: 04-13-2010, 12:17 AM
  3. probleme with assert statement
    By pierre in forum New To Java
    Replies: 3
    Last Post: 10-23-2009, 10:10 PM
  4. Replies: 1
    Last Post: 04-21-2009, 11:20 PM
  5. Replies: 2
    Last Post: 12-23-2008, 06:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •