db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anna_a <frida.harrys...@gmail.com>
Subject Problems with updating database
Date Tue, 01 Sep 2009 09:40:46 GMT

Hi,
I am using Netbeans and Derby database and in my code I have a function
where I want the user to tell me which attribute of an actor they want
changed (the actor and its attributes are represented in a table in my
database) and this attribute's name along with the new value of the
attribute and the actor id will be passed to an "updateDatabase"function.
But how do i write a statement or preparedStatement when I don't know
beforehand what column is supposed to get changed?
If I knew the attribute I would write
update actor set attributeName = newValue where actor_id = ?

but I don't know how to do this since the attributeName will vary and will
be passed to the updateDatabase-function from another function.

Thankful for all suggestions!
-- 
View this message in context: http://www.nabble.com/Problems-with-updating-database-tp25237294p25237294.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message