This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes sql inserting large String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "sql inserting large String" Watch "sql inserting large String" New topic
Author

sql inserting large String

riya chacko
Greenhorn

Joined: Oct 20, 2001
Posts: 7
Hi,
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
Thanks
Riya
Frank Carver
Sheriff

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
Rancher

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.
Dave.
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.
Jamie
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
hi,
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.)
chantal
riya chacko
Greenhorn

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
 
Similar Threads
HiberNate with <sql-insert
sql inserting large String
handle special characters from text area using
Servlet and JDBC error
Not able to insert image more than 4K in Database