?
Solved

Image load to Sybase from JDBC

Posted on 1997-03-27
2
Medium Priority
?
500 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 400 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

801 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