Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting in result set greater than 255 characters

 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I currently have code that gets a result set from a stored procedure. Though the stored proc is coded with the output as a varchar(11000) the value inside the java code is getting truncated to 255 characters. The java type being used is Types.LONGVARCHAR.
I am using JDK1.5, so LongNVARCHAR is not supported.

Any ideas on how I can get the entire string (the result set currently is 900 characters long)
Here is the code and the stored procedure:

Java Code:


Stored proc is defined as follows:


The value of @ResultDate is 08/27/2010,11/27/2010,02/27/2011,05/27/2011,08/27/2011,11/27/2011,02/27/2012,05/27/2012,08/27/2012,11/27/2012,02/27/2013,05/27/2013,08/27/2013,11/27/2013,02/27/2014,05/27/2014,08/27/2014,11/27/2014,02/27/2015,05/27/2015,08/27/2015,11/27/2015,02/27/2016,05/27/2016,08/27/2016,11/27/2016,02/27/2017,05/27/2017,08/27/2017,11/27/2017,02/27/2018,05/27/2018,08/27/2018,11/27/2018,02/27/2019,05/27/2019,08/27/2019,11/27/2019,02/27/2020,05/27/2020,08/27/2020,11/27/2020,02/27/2021,05/27/2021,08/27/2021,11/27/2021,02/27/2022,05/27/2022,08/27/2022,11/27/2022,02/27/2023,05/27/2023,08/27/2023,11/27/2023,02/27/2024,

But the value stored in result is 08/27/2010,11/27/2010,02/27/2011,05/27/2011,08/27/2011,11/27/2011,02/27/2012,05/27/2012,08/27/2012,11/27/2012,02/27/2013,05/27/2013,08/27/2013,11/27/2013,02/27/2014,05/27/2014,08/27/2014,11/27/2014,02/27/2015,

So it gets truncated to 255 characters. Please help!!

Thank you
Karthik
 
Scott Selikoff
author
Saloon Keeper
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This probably is an issue with the driver, not Java nor your JDBC code. Consult the driver documentation. There is probably a connection string parameter to increase the max size of a return value.

You also might try reading the value as a binary type (stream) such as a blob since 11000 is pretty long for a database String.
 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Scott. I did some research and found I had to use JCONNECT_VERION=6. Jboss defaults it to 5 apparently.
Now it works!

Thank you
Karthik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic