[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Image load to Sybase from JDBC

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
This video teaches viewers about errors in exception handling.
Suggested Courses

656 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