Solved

Image load to Sybase from JDBC

Posted on 1997-03-27
2
495 Views
Last Modified: 2008-03-06
Hey,

we're trying to store and retrieve GIF files to a Sybase System 11 server from (originally) disk files. We're using J++ as the development environment and WebLogic's JDBC driver as the interface.

We are having a problem where if a table has an image field in it, then JDBC cannot open the table.

What we want to know:

Is this a limitation of only the WebLogic driver, or do other JDBC drivers have the same problem?

If someone else has gotten the WebLogic driver to work, how? Could you provide us with the configuration information or sample code showing the retrieve?

Thanks
0
Comment
Question by:tharlan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Expert Comment

by:donnyt
ID: 1219288
We're not using WebLogic, but we're using Connect (http://www.connectsw.com).  For Sybase, you need to do something like:
      
      /*
      Setup connnections, try/catch, create Statement stmt,                   ResultSet rs, send SQL query and get ResultSet rs, etc..
      */
      ..

      InputStream is = rs.getBinaryStream(1);
      is.skip(2);      // For Sybase, skip 2 bytes for Images
      is.read(buffer, 0, imageSize);

      ..      
      /*  buffer is a byte[] array, imageSize is some number
          of bytes you want to read
      */

      Once image is in memory as byte[] (buffer, in the above             example), you can preprocess it and use MemoryImageSource
      to create an Image.
0
 
LVL 1

Accepted Solution

by:
trof earned 200 total points
ID: 1219289
JDBC does not implemented in J++ (yet). Do you use MS JDK 2.0 prerelease or just classes from Sun JDK , and what kind of JDBC driver (sorry I know nothing about WebLogic's)? If it's J++ & SunJDK  & JDBC/ODBC bridge - it definitely won't work - MS did not implement native methods calls properly(actually, they did not promice to do it). Try to use MS JDK 2.0, but remember, it's beta, so, nothing is garanteed. J++ and JDBC still don't like each other...
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

705 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