Results 1 to 6 of 6
- 04-08-2011, 08:18 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 2
- Rep Power
- 0
Problem while retrieving column size of ResultSet
Hi,
A procedure returns 300 characters of warning message(column name is 'popupwarning'). When i am retrieving the column value using getObject() method of ResultSet object it is getting only 255 characters and remaining 45 characters are missing. But procedure is correctly returning as 300 characters of warning message.I am using datasource creATED in WebSphere Application Server v6.1 to get the connection object.
below is the sample code:
Object res=rs.getObject(colName);
While debugging the code found that in res object only 255 chars are getting and remaining 45 characters are missing. Problem seems to be there may be some column length defalted to 255 chars. But i did not find where it is exactly defaulted. OR please help anyone ow to retrieve the more than 255 chars returned by database using getObject() method of ResultSet object.
Database we using is Sybase and server is WebSphere.
Thanks in Advance.
- 04-11-2011, 10:52 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
I would suggest it's however you're outputting this.
How have you determined that the value of that getObject() is only 255 characters long?
Can you reproduce this in a test program? Should be eay to do.
- 04-11-2011, 10:59 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Maybe it's in the data definition statement where you create a column of type varchar(255) or similar?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-11-2011, 11:03 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Well, the OP says "But procedure is correctly returning as 300 characters of warning message."
Now, of course, we have nothing to show us that is in fact the case...:)
- 04-11-2011, 04:43 PM #5
Member
- Join Date
- Apr 2011
- Posts
- 2
- Rep Power
- 0
Problem while retrieving column size of ResultSet
Hi TollS,
getDisplaySize() of ResultMetaData returns the Max column length size.
Here is the problem with the Sybase JDBC2 driver. If I use Sybase JDBC3 Driver problem solves. Max column length size for this JDBC3 driver is 500 chars.
But I do not want to use the JDBC3 driver.
I need solution using JDBC2 driver. I think there are some driver settings for this character size.
Can any one help it out how these driver settings be done?
I am WebSphere Application Server v6.1
- 04-11-2011, 04:52 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
ResultSet size
By bugger in forum JDBCReplies: 18Last Post: 06-25-2011, 08:36 PM -
To set selective font, color and size for a column in a table
By sas in forum AWT / SwingReplies: 3Last Post: 04-05-2011, 02:46 PM -
Using input from JTextField to adjust column size of another
By Trdmrk in forum AWT / SwingReplies: 1Last Post: 07-19-2010, 12:31 AM -
Problem in Retrieving AES key from encryptedKeyFile using Private Key
By softpratibh in forum Advanced JavaReplies: 0Last Post: 12-30-2009, 06:46 AM -
Problem with storing and retrieving from a textfile
By Albert in forum Advanced JavaReplies: 1Last Post: 07-13-2007, 03:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks