This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi All, I am trying to access resultset two times like this System.out.println(rs.getInt(1)); int i= rs.getInt(1); but it is givine nodata found exception, but if I remove System.out.println(rs.getInt(1)); it works fine. So my question is why we can't access result two times for getting same data.
Hi Vikas, the reason for that is that the default implementation of the Result set is of iterator pattern and the behaviour is scroll forward only. you can achieve this by changing the type of the Resultset Object to be created...I dont remember the syntax now...but some thing to do with the constants in the ResultSet class. the other simple thing you could do it store the first getXXX return value in a local Variable and refer to this..you could avoid the burden on the result set. hope this helps.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com