15,000 Jobs Available in:
Java, ASP, C#, PHP, SQL, SAP, MySQL and many more.
- Class Quick -
The moose likes JDBC and the fly likes saving nclob data into database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JDBC
Reply Bookmark "saving nclob data into database" Watch "saving nclob data into database" New topic
Author

saving nclob data into database

mahesh kapure
Greenhorn

Joined: Sep 17, 2008
Posts: 6
hi,

i am having nclob datatype of one column in the table.

when i am trying to insert the values into, it will save till first line of text. it didnt save other lines of text. the code to save lines is

StringReader reader = new StringReader(mutilinetext);
statement.setCharacterStream(1, reader, mutilinetext.length());

please help.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48842

Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets. For more information, please read this.

This post has been moved to a more appropriate forum.

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 607

I can't reproduce this. Can you post a sample of the multi-line text you are using and the full code (inside code tags)?

also, the versions of DB, jdbc driver, and of Java you are using
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1287

mutilinetext is the object of what ?

if it is a File Object.. then .length() method is return long, while setCharacterStream() accept int for length.

hope it helps.


Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1287

here is an example.
 
 
subject: saving nclob data into database
 
MyEclipse, The Clear Choice