Sybase Image column gets truncated to 16K

Posted on 2006-05-23
Last Modified: 2008-01-09
We have  two environments Test and Development. Both running on same version of Sybase server  --Adaptive Server Enterprise/12.5.1/EBF 11559 ESD#1/P/Sun_svr4/OS 5.8/ase1251/1831/32-bit/FBO/Sat Nov 2--

We have a Table with one of the column defined as Image. We are storing pdf documents in that column. But for some reason , the pdf documents gets truncated to 16k in our Test environment whereas the same works on  Development.

Our project is a typical j2EE project. so we use hibernate from the java layer to handle all database operations. We are using jconn2.jar as the database driver.

Listes below are our findings.

1)  IF we use a different driver jar file , like the one that comes along with weblogic for Sybase, we could successfully insert the pdf document even in our test environment.

Question by:SubhaBabu
    LVL 6

    Accepted Solution

    does your code have something like the following
        SET stringsize 16384

    you may need to up your maximum string size
    LVL 2

    Author Comment

    Nope i don't have any like that.  I am using  pure java driver (jconn2.jar) to talk to database from  my java tier.
    LVL 6

    Expert Comment

    you might have to post a cut down version of the code
    LVL 24

    Assisted Solution

    by:Joe Woodhouse
    The text/image size is a connection property of your Java connection string. If you don't explicitly set it, it defaults to a size depending on the client you're using.

    For example, through a regular isql I believe it will default to 32Kb.

    I don't know Java so I don't know exactly what it will be. You may also be able to send the "SET" command that ChrisKing (hi Chris) mentioned to explictly set it for the duration of this session, but then you'll have to do this for every connection every time.
    LVL 6

    Expert Comment

    (hi joe)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now