Do you have a suggestion for an alternative to using a Java ResultSet?

Hello,

I’ve just started on a Java project using Words. It doesn’t appear that Java has a DataSet / DataTable class, unlike .NET, and that the closest equivalent is a ResultSet. The problem is that the data I’m merging into a Word template isn’t coming from a SQL query – it’s the result of a web service call.

I noticed some posting on the Aspose site where you all gave an example of using a CachedRowSet, but I’m finding that it’s not very flexible, say, if you wanted to add new columns after data rows have been added, or otherwise query the data contained within the ResultSet.

Do you all have any suggestions for a library that would be more flexible than a CachedRowSet, but still interfaces with a ResultSet so it can be used in a Words mail merge routine?

Thanks so much for your suggestion,

~~ Michael

Hi Michael,

Thanks for your query. In your case, I suggest you please use IMailMergeDataSource interface. Please read article in following documentation link for your kind reference. This article provides a simple example of how, using Aspose.Words, you can execute mail merge from XML using a custom data source which implements the IMailMergeDataSource interface .

http://www.aspose.com/docs/display/wordsjava/How+to++Mail+Merge+from+XML+using+IMailMergeDataSource
http://www.aspose.com/docs/display/wordsjava/IMailMergeDataSource

Please let us know if you have any more queries.

That’s very helpful – thank you. I’ll go this direction.

Hi Michael,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.