Thursday, November 20, 2008

Problem solved:- INSERT data to the table using hibernate

Problem solved:- INSERT data to the table using hibernate

I was fortunate to solve the problem I faced in inserting the data to the table using hibernate
I have been trying out for a long time .
Yesterday I thought I will start from scratch . I took the eg tutorial from roseindia (http://www.roseindia.net/hibernate/incrementgenerator.shtml )
I selected this example to try out auto increment for primary key and insert key
I was getting the error .
“Could not find UserTransaction in JNDI “
I searched was not able to find the solution . Today morning I remembered vague about Niyas explanation some time back about the changes which we have to do in “hibernate.cfg.xml” for JDBC . I tried to solve it and was success
the changes which I had done I had cut and pasted for my future reference


Error Could not find user Transaction in JNDI

Sol:-
Modified "hibernate.cfg.xml" file
I had cut and pasted it for reference






Now I am able to insert the data into this table . I understood the way auto increment work

No comments: