List Info

Thread: 1 new message in 1 topic - digest




1 new message in 1 topic - digest
user name
2006-08-26 12:47:17
u must create object and set its values den put into session.save obj
ok

---------- Forwarded message ----------
From: java-and-hibernate group <googlegroups.com">noreplygooglegroups.com >;
Date: 25-Aug-2006 12:55
Subject: 1 new message in 1 topic - digest
To: java-and-hibernate digest subscribers <googlegroups.com">java-and-hibernategooglegroups.com>


java and hibernate
http://groups.google.com/group/java-and-hibernate

googlegroups.com">java-and-hibernategooglegroups.com

Today's topics:

* connection error - 1 messages, 1 author
http://groups.google.com/group/java-and-hibernate/browse_thread/thread/706dcc74ad744f9a

==============================================================================
TOPIC: connection error
http://groups.google.com/group/java-and-hibernate/browse_thread/thread/706dcc74ad744f9a
==============================================================================

== 1 of 1 ==
Date: Thurs, Aug 24 2006 11:40pm
From: "sas&quot;


i m sending an object through a function and wants to put in a
database.i m using hibernate for this and getting the error can anybody
help me out regarding this...here is my code...
package parse;
import org.hibernate.*;
import org.hibernate.Session;
import org.hibernate.SessionFactory ;
import org.hibernate.cfg.Configuration;
import java.util.*;

public class Dbinsert {

 &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  void dbinsert(Data obj){
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; Session session = null;

&nbsp; &nbsp; &nbsp; try{

 ; &nbsp; &nbsp;  System.out.println (&quot;starting");

 &nbsp; &nbsp; SessionFactory sessionFactory = new
Configuration().configure().buildSessionFactory();
 &nbsp; &nbsp; &nbsp; &nbsp;   ; System.out.println("sessionFactory"+sessionFactory);
 &nbsp;   ; session = sessionFactory.openSession();

 &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Inserting Record&quot;);
   ; &nbsp; &nbsp; //Object obj = new Object();


 &nbsp; &nbsp; &nbsp; session.save(obj);
&nbsp; &nbsp;   ; System.out.println(&quot;Done&quot;);
&nbsp;  }catch(NullPointerException e){
   ;  e.printStackTrace();
  ; }catch(Throwable ex){
 ; &nbsp;  ex.printStackTrace();
 &nbsp; }finally{
  ; &nbsp; &nbsp; System.out.println(&quot;session"+session);

&nbsp; &nbsp;  session.flush ();
&nbsp; &nbsp;  session.close();
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; }
 &nbsp; &nbsp; }



}

i m getting the output like
sessionnull
java.lang.Nullpointerexception.





==============================================================================

You received this message because you are subscribed to the Google Groups "java and hibernate&quot;
group.

To post to this group, send email to googlegroups.com">java-and-hibernategooglegroups.com or
visit http://groups.google.com/group/java-and-hibernate

To unsubscribe from this group, send email to googlegroups.com"> java-and-hibernate-unsubscribegooglegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/java-and-hibernate/subscribe

To report abuse, send email explaining the problem to googlegroups.com">abusegooglegroups.com

==============================================================================
Google Groups: http://groups.google.com
 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "java and hibernate&quot; group.
To post to this group, send email to java-and-hibernategooglegroups.com
To unsubscribe from this group, send email to java-and-hibernate-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/java-and-hibernate
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )