Can anyone give me working example of using Disconnected rowset in Java .I had tried the example from sun site but it gives me acceptChanges Failed Exception when trying to update the Database.. Please HELP ITS URGENT !!!11 regards Sada
hi, Thanx for the URL the example worked fine The problem was that when i was updating i was updating a single column and as there where some columns in the table whose values should not be null.So the Cachedrowset was trying to update the other columns with null values ( I think this is incorrect way of updating for the cachedrowset it should onl update the single column without touching others or should update othersa with older values Isn't it correct to do that way ) Another thing is that the exception given by the Cachedrowset is not correct because it is difficult to understand the what went wrong.AS it almost took 2 hrs for me to solve this. As always it was giving me accept failed exception. Now my question is 1) Is there anyway to understand what type of Exception is thrown by the Cached Rowset..?? 2)My another question is bit unrelated to above problem but related to RecordSet of java.I wanna update the table using updateRow() of the Resultset class.It doesnot work why..?? It gives me a exception saying the it doesnot support the command. If the driver does not support scrolling and updation then how come it work with the CachedRowset.Iam using same drivers in both cases. Please do help me.....
Iam sorry if its bit comfusing.... thanx again for the link regards Sada
Joined: May 17, 2001
Sorry. I am not sure I understand your question. You can scroll with a CachedRowSet because it is disconnected from the database, hence it it just like any other regular Java bean. What are you trying to do and what exception are you getting?
In a nutshell, it sounds like your driver does not support scrollable resultsets. Therefore, you can not perform resultset updates. But you already know this! It makes sense that the same is not possible for the CachedRowSet. The reason you can scroll through the CachedRowSet is that the fields are stored in memory, appearing to be scrollable. But since it inherits the java.sql.ResultSet methods when it comes to updating, you'll have the same problem as when you use the ResultSets(even if the error messages suck and are misleading!). You can update your ODBC driver to one that implements the scrollable resultset, and that would probably solve your problem.(how and where to update your driver, I don't know, but I know you can!) Jamie