[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ResultSet.updateXXX not supported, what to do instead?



Hi,
 I'm relatively new to JDBC and SQL, so I'm following sun's tutorials.
Now I have found, that ResultSet returned by mckoi does not support
updateXXX methods. I have two questions then:

 1. How do I detect, if method is supported or not? Is there a method
which I may querry and check, if updateXXX is supported? Asking
ResultSet for its ResultSetMetaData.isWritable returns true for every
column, what suggests update should work

 2. How can I achive similar functionality? I know about SQL UPDATE
command, but I don't know how to prepare its string from data in
ResultSet. Note, I have made my ResultSet to contain only few columns
from database, so I can't extract columns names and values from row and
expect those will point to exactly one row in database.

 3. If I will have to use UPDATE instead of ResultSet.updateXXX, then
can I have two identical rows in database? In my case, where database
will store some measurements it is possible. SELECT will work  with it,
but how to make UPDATE to work (ie. update only one of two identical
rows)? 

  I know, I ask too many questions at once :(

regards
    Tomasz Sztejka.

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer