Your trouble is here:

pstmtname = conn.prepareStatement(sql);
 sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE ROW_ID =
" + UserID;


 
When you call prepareStatement(sql) the sql string is sent to the database 
which "prepares" it (essentially does all the steps neccessary before 
execution). You then change the sql string and the database knows nothing about 
it.

Change it so that the sql = line comes before the conn.prepareStatement line.

 

Chris
 

 

-----Original Message-----
From: Nguyen Xuan Son <yama...@gmail.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Tue, Dec 8, 2009 12:59 am
Subject: SQL ExcuteQuery


dear all
I've written
Connection conn = null;
PreparedStatement pstmtname = null;
pstmtname = conn.prepareStatement(sql);
 sql = "UPDATE tbl_content_admin_accounts SET CA_PASSWORD = ? WHERE ROW_ID =
" + UserID;
pstmtname.setString(1, "123456");
pstmtname.executeQuery();

there is no error appear but nothing is changed in the database
do you have any suggestion?
thank you very much

-- 
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email    : nr000...@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
=======================================================================

 

Reply via email to