Forum: CSV Manager, Topic: ResultSet- writing nulls as "" http://www.ricebridge.com/feeds/forums/csvman/5.rss Copyright (c) 2004 Ricebridge Topic Posts Tue Aug 02 14:41:54 UTC 2005 Richard Rodger: In order for the CsvMa http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post16 In order for the CsvManagerStore.setResultSetLineProvider method to work, you will still need to subclass the original ResultSetLineProvider. Of course, your own class will have the full implementation and not actually use anything from the super-class. Tue, 02 Aug 2005 14:41:54 UTC Q Khawaja: scratch that I have go http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post15 scratch that I have got it, thanks Tue, 02 Aug 2005 12:10:02 UTC Q Khawaja: where can I get the so http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post14 where can I get the source for this class? Tue, 02 Aug 2005 12:07:31 UTC Richard Rodger: Ouch! Good Point - tha http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post13 Ouch! Good Point - that will have to change. As a workaround to solve your problem, I would suggest making a full copy of ResultSetLineListener and modifying that, instead of subclassing. Tue, 02 Aug 2005 11:59:44 UTC Q Khawaja: Unfortunately iResultS http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post12 Unfortunately iResultSet and iFieldIndex are private in the super class and are therefore not visible to the subclass Tue, 02 Aug 2005 11:56:44 UTC Richard Rodger: CsvManager saves a Res http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post11 CsvManager saves a ResultSet to a file using the ResultSetLineProvider class. The reason that nulls are not blank is from this line: field = String.valueOf( iResultSet.getObject( iFieldIndex ) ); in the nextFieldImpl method. (the source of ResultSetLineProvider is shown in the API documentation). To change the behaviour of this class, you need create your own ResultSetLineProvider that does what you need - so subclass ResultSetLineProvider, and then say: csvManager.getCsvManagerStore().setResultSetLineProvider( myResultSetLineProvider ); In your own Provider, use something like: String field = ""; Object obj = iResultSet.getObject( iFieldIndex ); if( null == obj ) { field = ""; } else { field = String.valueOf(obj); } In the next version of CsvManager, I will make this more configurable, so thanks for pointing it out. Mon, 01 Aug 2005 15:55:05 UTC Q Khawaja: I am saving a JDBC res http://local.ricebridge.com/forum/topic.htm?f=csvman&t=5&s=all#post10 I am saving a JDBC resultset to fiile. Could anyone advise me how I can make all values that are null as "" i.e. as a blank. Thanks in advance Q Mon, 01 Aug 2005 14:51:17 UTC