Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql inserting large String

 
riya chacko
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really nore appropriate to the JDBC forum, so I've moved it for you.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic