File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes saving nclob data into database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "saving nclob data into database" Watch "saving nclob data into database" New topic

saving nclob data into database

mahesh kapure

Joined: Sep 17, 2008
Posts: 7

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 ninkuma

Joined: Jan 10, 2002
Posts: 63838

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.

[Asking smart questions] [About Bear] [Books by Bear]
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

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: 1323

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.

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

Joined: Dec 06, 2005
Posts: 1323

here is an example.
I agree. Here's the link:
subject: saving nclob data into database
It's not a secret anymore!