_Esam
asked on
Update a record through JDBC
Hi,
I need to know how to update a record with jdbc with a previous value in the table column!
I want to update a record and set a count column like count+1 for certain condition?
How I do that?
_Esam
I need to know how to update a record with jdbc with a previous value in the table column!
I want to update a record and set a count column like count+1 for certain condition?
How I do that?
_Esam
ASKER
You missed my point, I think...
>"update table_name set col_name = value where col_key = value" - I know this..
I wanted to know .. how could I do it.. if I wanted to increment the value by 1 ???
_Esam
>"update table_name set col_name = value where col_key = value" - I know this..
I wanted to know .. how could I do it.. if I wanted to increment the value by 1 ???
_Esam
select that column, increment it and update the new value to the database,
else write a stored procedure in DB and call that from ur java class
else write a stored procedure in DB and call that from ur java class
Use an updatable ResultSet
ASKER
I couldn't update the Timestamp with the Updatable ResultSet ???
Can't believe circling in the same loop :)
No Stored Procedure for me!! Forbidden for me !! :)
Thanks.
_Esam
Can't believe circling in the same loop :)
No Stored Procedure for me!! Forbidden for me !! :)
Thanks.
_Esam
ASKER
>Use an updatable ResultSet
How ?
Please show me for clarity!
Thanks.
_Esam
How ?
Please show me for clarity!
Thanks.
_Esam
You already know - you did it before ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Didn't work for me ! :)
Let us make it work !
_Esam
Let us make it work !
_Esam
wat is the datatype of that column??
ASKER
Sorry mukundha...
It finally worked .. can't be sure what the problem was..
Luckily the datatype is a number..
Thanks..
_Esam
It finally worked .. can't be sure what the problem was..
Luckily the datatype is a number..
Thanks..
_Esam
create a statement or prepared statement with the query,
"update table_name set col_name = value where col_key = value"
and call executeUpdate() ;