db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@twinix.com
Subject Re: Problems with updating database
Date Thu, 10 Sep 2009 09:18:01 GMT
See Thread at: http://www.techienuggets.com/Detail?tx=98825 Posted on behalf of a User

Just declare a variable.. 

In Response To: 

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!
<...> http://www.nabble.com/Problems-with-updating-database-tp25237294p25237294.html
Sent from the Apache Derby Users mailing list archive at <...>.

View raw message