This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Insert and retrieve new line character in DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Insert and retrieve new line character in DB2" Watch "Insert and retrieve new line character in DB2" New topic
Author

Insert and retrieve new line character in DB2

Mahesh Srinivas
Greenhorn

Joined: Nov 22, 2008
Posts: 6
Hi,
I have a requirement in my project where I need to generate flat files to be sent to the bank for validation and for each record type in the flat file, I want to have a line separator inserted in the file. Now, the line seperator is configurable as a system option as per customers needs which is stored in the database (we are using DB2). Even though, I inserted '\n' (New line character) in the system option as a line separator, while retrieving from database through JDBC and appending to the flat file, it is not recognizing it as a new line character and simply appends '\n\ in the flat file.

Please suggest any solution for this.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Insert and retrieve new line character in DB2