Good Day hopping you are all well,
I have a question concerning Database and Resultset. For Example if I am performing an SQL INSERT or UPDATE the data saved in the database ist changed but the data in the resultset is not!
I understood that this objects are independend from each other and that I can change the content of the Resultset only by a SELECT.
Up to now I am performing the SQL Command and after that I am performing a SELECT to update the Resultset Data. It seems to me that going this way is not efficient if I am working with a Database having heavy Data load (a Million or more records). Allways performing a SELECT to update the Resultset will cost time.
Question:
Anyone knowing a way to insert, delete or update the Resultset by placing the cursor on the row and transfering the values direct to the columns. This question or idea is comming up because I understood that the Resultset is equal to a memory table.
I have a question concerning Database and Resultset. For Example if I am performing an SQL INSERT or UPDATE the data saved in the database ist changed but the data in the resultset is not!
Ok thank you for your quick response and now step by step...
As you wrote 'do a SELECT' is exactly what I do and what I pointed out in my post.
I also posted that I know that a resultset is not affected by SQL Commands except SELECT.
Sorry but to repeat what I wrote does not help me.
It is not the question what I am doing on a special project. The question is in general important to get knowledge about the best and quickest way to do it. May be that at the end the last answer is 'NO other way than SELECT again'. But I think we are not at this point.
In your 2nd reply you talk about the Database. You are to be right no one will make SELECT with a million of records. That statement was only to point to the background of the question dealing with heavy dataload of databases. In a project there is a database with many thousands of records containing description and sales data of products sold worldwide. On base of this example there are cases where the result of a SELECT will have hundreds or even more than a thousand of records. To examin them or for printout.
At least the question is still open. Conclusion to the audiance Any other Ideas?
It has to be set from java as I don't think it's in the resultset library.
It allows the resultset to be updated and reflect changes back to the underlying database.
Whereas now we have readString(...) you gain updateString(...,value).
If used with SENSITIVE , the resultset is 'live' and will change with outside database changes.
Not too hard to use, but you have to weigh up the extra effort involved against using select then update queries.
I don't understand the question.
After you issue a SELECT command, the returned resultset is used for reading.
It is not intended for writing.
I never come across the need to write to this temporary data.
If I want to, I can issue another SQL command.