jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes sql inserting large String 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 "sql inserting large String" Watch "sql inserting large String" New topic

sql inserting large String

riya chacko

Joined: Oct 20, 2001
Posts: 7
Thanks in advance.
Can any one pls help me in this problem.
I am trying to get a very large String from foxpro db(connected using JDBCODBC DRIVER)and trying to insert this string in sql table,using preparedStatement method setString.But sql is not allowing to insert this much big string.Simply raising null pointer exception.I could able retrieve the string from foxpro.Inserting to sql is the problem
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
This is really nore appropriate to the JDBC forum, so I've moved it for you.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Thanks Frank
If the String is extremely large (anyone have an idea on the limit for this?) you'll probably have to store it as a BLOB (or related), not a String.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

I believe it is 2K (it may be higher like 4k for newer versions of Oracle). If you were looking for some source code, there's plenty on the Oracle site:
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/content.html and click on "JDBC Advanced Features Samples" to find LOB examples.
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
maybe the reason is just that VARCHAR is limited to 255 chars while TEXT is unlimited (in some sort - i mean: i don't know what's its limit ;-) ). so if your setting the datatype to some varchar thing, change it to TEXT. (sorry, if thats way out of the range of your question, you didn'tspecify any size.)
riya chacko

Joined: Oct 20, 2001
Posts: 7
destination datatype is text of length 16 only.not varchar.
The length of the string is 2048618.
This much big string sql is not allowing to insert.
I agree. Here's the link: http://aspose.com/file-tools
subject: sql inserting large String
jQuery in Action, 3rd edition