Results 1 to 6 of 6
  1. #1
    gurrapuk is offline Member
    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    Question 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.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    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.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Maybe it's in the data definition statement where you create a column of type varchar(255) or similar?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    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...:)

  5. #5
    gurrapuk is offline Member
    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    Question 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

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    Since this is not something that afflicts any other driver I've used I would suggest you take this to Sybase and ask them.

Similar Threads

  1. ResultSet size
    By bugger in forum JDBC
    Replies: 18
    Last Post: 06-25-2011, 08:36 PM
  2. Replies: 3
    Last Post: 04-05-2011, 02:46 PM
  3. Replies: 1
    Last Post: 07-19-2010, 12:31 AM
  4. Replies: 0
    Last Post: 12-30-2009, 06:46 AM
  5. Problem with storing and retrieving from a textfile
    By Albert in forum Advanced Java
    Replies: 1
    Last Post: 07-13-2007, 03:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •