File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes isWritable vs isDefinatelyWritable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "isWritable vs isDefinatelyWritable" Watch "isWritable vs isDefinatelyWritable" New topic
Author

isWritable vs isDefinatelyWritable

Galen Benson
Greenhorn

Joined: Dec 06, 2004
Posts: 8
Can anyone explain to me the difference in the ResultSetMetaData class between the isWritable vs isDefinatelyWritable? I'm in a class and none of us can figure out what the specific differences are. We are using DB2.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Galen,
Let's start with the API from the JavaDoc:
isDefinitelyWritable - Indicates whether a write on the designated column will definitely succeed.
isWritable - Indicates whether it is possible for a write on the designated column to succeed.

The difference has to do with database locks. For isDefinitelyWritable(), I must already have a write lock to guarantee that the write will succeed. For isWritable(), it is sufficient that nobody else has a write lock so it at least possible for the write to succeed. isWritable() is more like a method to check that a write will not definitely fail.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: isWritable vs isDefinatelyWritable