hibernate update problem

hibernate update problem

HI,

I integrated the struts and hibernate and wrote the following query in the databean to update the user table login time

SessionFactory sessionFactory = (SessionFactory)context.getAttribute(HibernatePlugin.KEY_NAME);
Session  session = sessionFactory.openSession();
Query query = session.createQuery("update LoginForm set logintime = '"+loginTime+"' where userid ='"+userId+"'");
int result = query.executeUpdate();
System.out.println("result : "+result);
if(result>0)
System.out.println("Updated Successfully");

userid and logintime is provided correctly. And the result showed me 1 in the print statement but my database isn't updating...

Pls Help...

Thanks in Advance

View Answers

January 2, 2011 at 12:33 PM

make sure that ur config file having true


February 28, 2011 at 8:29 PM

how to make config file true









Related Tutorials/Questions & Answers:
hibernate update problem
hibernate update problem  HI, I integrated the struts and hibernate and wrote the following query in the databean to update the user table login... = session.createQuery("update LoginForm set logintime = '"+loginTime+"' where
Update not working in hibernate.
Update not working in hibernate.  Update not working in hibernate
Advertisements
HQL update problem
HQL update problem  public void saveGuest(List<Long> listid) throws HibernateException{ SessionFactory sf... { session=sf.openSession(); Query qry= session.createQuery("update
Where to update the Hibernate tools?
Where to update the Hibernate tools?  Hi, What is the url to to update the hibernate tool in eclipse? Thanks   Hi, Hi if you are using the hibernate tool you can update it. Check Check the tutorial Hibernate tools
How to update table in Hibernate
How to update table in Hibernate  Hi, I have a table in database that has two fields in it. Student Name and ID, can anyone explain me how to update these tables in Hibernate. Thanks.   Update table query in Hibernate
Problem in updating query in Hibernate - Hibernate
Problem in updating query in Hibernate  Hi, I have used a query to update the existing columns of one table. The query updates the records in the main table but it does not update the tables that are mapped from the main table
Dynamic-update not working in Hibernate.
Dynamic-update not working in Hibernate.  Why is dynamic update not working in hibernate?   Dynamic-update is not working. It means when you are running your update, new data is added in your table in place
Hibernate code problem - Hibernate
Hibernate code problem  Hi, This is Birendra Pradhan.I want... & Regards Birendra  Hi friend, For solving the problem visit to : http://www.roseindia.net/hibernate/index.shtml Thanks
hibernate problem
hibernate problem  please help me.... log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please...:12) i am getting this prob while running my hibernate program in Eclips please
Hibernate code problem - Hibernate
Hibernate code problem  Hi This is Raju.I tried the first example of Hibernate material what u have given. I have written contact.java... session.flush(); i am using hibernate 3.3.1 and I kept hibernate3.jar
Blob update in hibernate
Blob update in hibernate  Hi , I wanted to upload a blob into mysql database using hibernate. Could you please help me . Thanks in advance, Satchidanand Mohanty
hibernate code problem - Hibernate
hibernate code problem  suppose i want to fetch a row from the table... . Please visit for more information. http://www.roseindia.net/hibernate/selectclause.shtml If you have any problem this send me detail and source code
Hibernate code problem - Hibernate
Hibernate code problem  how to write hibernate Left outer join program
Hibernate code problem - Hibernate
Hibernate code problem   Hi This is Raju I tried the first example of hibernate course material.This is to insert a record into CONTACT table.Is Hibernate code automatically creates the CONTACT table and then insert
hibernate code problem - Hibernate
hibernate code problem  String SQL_QUERY =" from Insurance...: " + insurance. getInsuranceName()); } in the above code,the hibernate...= request.getParameter("name"); For more information on hibernate visit to : http
hibernate insertion problem - Hibernate
hibernate insertion problem  Hi , Thanks for the material .Its very gud . when i run FirstExample.java i get the message insertion has been done int the table contact . but whne i look into database data is not inserted
Hibernate update Method
Hibernate update Method In this tutorial you will learn about the update method in Hibernate Hibernate's update method saves the modified value... will use an update method of Hibernate to update the record of table. Complete
Difference between and merge and update in hibernate
Difference between and merge and update in hibernate  What is difference between and merge and update in hibernate?   Use update() if you are sure that the session does not contain an already persistent instance
Hibernate code problem - Hibernate
Hibernate code problem  Hai, iam working on simple login application using hibernate in spring. I've used Spring dependency injection too.I struck at DAO(data access Object)layer while executing the select statement in HQL
Hibernate tools update site
Hibernate tools update site Are you looking for hibernate tools update site? Hibernate Tools is also available for the popular Eclipse plugin. You can... productivity. Hibernate tools update site is http://download.jboss.org/jbosstools
Problem with Hibernate or 11g
Problem with Hibernate or 11g  Hi I am using Hibernate and 11g in my project. The problem I am facing is I am executing a query from java class... on Created date column by using hibernate query language. The Problem is every
Update value of database using hibernate.
Update value of database using hibernate.  How to update value of database using hibernate?   Hibernate provides facility to update..."); } } Output: Hibernate: select employee0_.emp_id as emp1_0_0_, employee0
Hibernate update Query
Hibernate update Query In this tutorial you will learn about an update query in Hibernate This tutorial is based on how to write HQl update query in hibernate. In hibernate update query updates the data of the database table when
delete query problem - Hibernate
correctly , the problem is only delete query. 2) query.executeUpate(); ->...(); Read for more information. http://www.roseindia.net/hibernate Thanks
Problem with open connection - Hibernate
Problem with open connection  Hi Team, I am running one hibernate application and the database is ORACLE 10g.I am getting the below error.I connected to the database by using JDBC(with same driver and url).Please tell me
Hibernate Tools Update Site
Hibernate Tools Update Site       Hibernate Tools Update Site In this section we will show you how to download and install Hibernate tools from Hibernate Tools Update
Eclipse hibernate problem
Eclipse hibernate problem  hie..i've just started a basic hibernate application using eclipse helios.I have added the jars,configured the xml files...;Hibernate Eclipse Integration Hibernate Tutorials
server problem - Hibernate
server problem  dear sir please give me best soloution how run hibernate and spring application on jboss and weblogic10.1.0 sever and compile thanks
update count from session - Hibernate
update count from session  I need to get the count of how many rows got updated by session.saveOrUpdate(). How would I get this? Thanks, mpr
Problem in running first hibernate program.... - Hibernate
Problem in running first hibernate program....  Hi...I am using.../hibernate/hibernatetools/hibernate-tools-update-site.shtml Again I downloaded... programs.It worked fine.To run a hibernate sample program,I followed the tutorial below
Hibernate @ManyToOne persisting problem - Hibernate
Hibernate @ManyToOne persisting problem  hello, In my apllication, there are students and classes. a student can take many classes. So there is OneToMany <--> ManyToOne relationship. Im my case, the best implementation
Hibernate Update Query
Hibernate Update Query       In this tutorial we will show how to update a row with new information..._ where insurance0_.ID=? Hibernate: update insurance set insurance_name
can we update table in hibernate with out primary key in table?
can we update table in hibernate with out primary key in table?  can we update table in hibernate with out primary key in table
Java Compilation error. Hibernate code problem. Struts first example - Hibernate
Java Compilation error. Hibernate code problem. Struts first example  Java Compilation error. Hibernate code problem. Struts first example
Hibernate Update
In this section we will discuss various method of update
hibernate pojo setter method problem
hibernate pojo setter method problem  how to pass a date type variable to a setter method in hibernate pojo class? //this is my pojo class import java.util.*; public class Employee { private String empname; private int
Webservices(Axis2 + tomcat ) Consuming Hibernate Giving Problem - Hibernate
Webservices(Axis2 + tomcat ) Consuming Hibernate Giving Problem  Hi Please tell me how can i integrate hibernate in axis2 for my webservice?? I tried in some ways..but its not working..Main problem is hibernate session
Tomcat installation problem - Hibernate Interview Questions
Tomcat installation problem   Hello
I am having problem with configuring Hibernate sessionfactory. Please Help
I am having problem with configuring Hibernate sessionfactory. Please Help  Sir, I am having problem with configuring Hibernate sessionfactory.. I was using the old version of Hibernate before now I am using Hibernate 4
update
update  how can i update multiple records in database using jsp ,servlet and jdbc based on selection of checkbox in jsp
Hibernate HQL Update
In this section we will discuss HQL update with example
update
update  Predict and justify the output of the following code snippet written by the developer to update the Status table: String str = "UPDATE m...://localhost:3306/roseindia", "root", "root"); String str = "UPDATE Status SET
HQL Update Statement to update database table
the example below...ADS_TO_REPLACE_1 Example of UPDATE Clause in Hibernate... insurance insurance0_ where insurance0_.ID=? Hibernate: update insurance set...HQL Update Statement to update database table HQL's update query statement
Problem in Spring 3 MVC and Hibernate 3 Example tutorial source codes
Problem in Spring 3 MVC and Hibernate 3 Example tutorial source codes  I referred your tutorial "Spring 3 MVC and Hibernate 3 Example" and downloaded...) ..... So please help me to solve this problem. I want to know is something
Hibernate : Dynamic-update
In this section we will discuss how dynamicUpdate works in Hibernate
Hibernate save or update method example
Hibernate save or update method example This tutorial is an example of loading... of the Session object. The Hibernate's saveOrUpdate method is very useful...='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "
Update value
Update value  How to update value of database using hibernate ?   Hi Samar, With the help of this code, you will see how can update database using hibernate. package net.roseindia.DAO; import
Hibernate Merge
In this section, you will learn about merge( ) method of Hibernate. Also the Difference between merge( ) and update( ) methods
update profile
update profile  coding for update profile
how to update
how to update   conditional update

Ads