-->
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 of an object via Hibernate
PostPosted: Fri May 13, 2005 5:37 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:

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

_________________
i m usinf Hibernate with Eclipse


Top
 Profile  
 
 Post subject: Re: Insertion of an object via Hibernate
PostPosted: Fri May 13, 2005 8:34 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
yann84 wrote:

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.

...

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


It's not a WARNing. It's INFOrmation. Just telling you that you're not binding the SessionFactory to JNDI. This is one way to make your session factory available from within a container but is certainly not required.


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.