11 messages in com.mysql.lists.javaRe: Why is this UPDATE NOT Working
FromSent OnAttachments
Ramesh05 Dec 2003 12:10 
Jeff Mathis05 Dec 2003 12:27 
Jeff Mathis05 Dec 2003 13:20 
Ramesh05 Dec 2003 13:20 
Ramesh05 Dec 2003 13:29 
Ramesh05 Dec 2003 13:47 
Kevin Fries05 Dec 2003 13:57 
Ramesh05 Dec 2003 14:22 
Kevin Fries05 Dec 2003 14:42 
Ramesh05 Dec 2003 16:45 
Ramesh05 Dec 2003 19:24 
Subject:Re: Why is this UPDATE NOT Working
From:Jeff Mathis (jmat@predict.com)
Date:12/05/2003 01:20:24 PM
List:com.mysql.lists.java

Not too long ago, I got tripped up by something like this. turned out I was issuing commit() on the wrong connection.

are your id fields really strings?

Ramesh wrote:

No, other updates work fine, just this one for some reason is not working.

I also tried doing this with: Aspire (http://www.onjava.com/pub/a/onjava/2002/10/30/aspire.html)

That gives me a message saying the rows were updated, but I go see in the tables and it is not the case.

12/5/03 9:35 AM: statement to execute : UPDATE <TABLE> SET NODE_ID = '550' WHERE MASTER_ID = '157' AND PARENT_NODE_ID = '552' 12/5/03 9:35 AM: Executing : UPDATE <TABLE> SET NODE_ID = '550' WHERE MASTER_ID = '157' AND NODE_ID = '552' 12/5/03 9:35 AM: Number of rows updated : 2 12/5/03 9:35 AM: db: Transaction being commited for request :request.UPDATE_PARENT_ID 12/5/03 9:35 AM: cp: Returning connection for pool aDB 12/5/03 9:35 AM: cp: Requesting a connection from data source aDB 12/5/03 9:35 AM: db: commit recognized

But as mentioned earlier, the same thing works fine from: SQLyog.

So, little confused as to where the problem might be.

thx

On Fri, 5 Dec 2003, Jeff Mathis wrote:

do you have auto-commit turned off?

Ramesh wrote:

Hi,

I am using: Driver: mysql-connector-java-3.0.9-stable-bin.jar Database: mysql 4.0.14

I am issuing a update stmt like: UPDATE <TABLE> SET NODE_ID = ? WHERE MASTER_ID = ? AND NODE_ID = ?

Using a PreparedStatement to do so, but it is just failing, no errors.

On the other hand, if I use a tool like: SQLyog and issue the same statement, it works fine.

What could be happening here?

Appreciate your input.