logo       

Problem with the LargeObjectManager class in 7.2.1 java libraries?: msg#00289

Subject: Problem with the LargeObjectManager class in 7.2.1 java libraries?

I’m trying to compile and build some java source code on a Windows XP Professional system.

 

The IDE I am using is NetBeans 3.4.1 and j2se 1.4.1_02 from Sun.  I have the pg72jdbc2.jar file in my class path for my IDE.

The source file compiles without any complaints but when I try to run it I get :

 

java.lang.NoClassDefFoundError: org/postgresql/largeobject/LargeObjectManager Exception in thread "main" ’

 

I am only including a pertinent code segment since the source file is rather lengthy.

 

Any ideas?  I was thinking that since I do not get any complaints until runtime that I might not have path variable  set properly.

 

Thanks,

-Bill Thomason

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

The top:

 

import java.io.*;

import java.util.*;

import java.sql.*;

import org.postgresql.largeobject.*;

import javax.jms.*;

 

.

.

.

    public void insertImage(ImageMsgObj imageObj) throws SQLException {

        if (this.c == null) {

            throw new SQLException("Connection is null in insertImage method.");

        } else {

            try {

                // All LargeObject API calls must be within a transaction

                // set auto commit to false

                c.setAutoCommit(false);

               

                // Get the Large Object Manager to perform operations with

                LargeObjectManager lobj = ((org.postgresql.Connection) c ).getLargeObjectAPI();

               

                //create a new large object

                int oid = lobj.create(LargeObjectManager.READ | LargeObjectManager.WRITE);

                

                //open the large object for write

                LargeObject obj = lobj.open(oid, LargeObjectManager.WRITE);

               

                // copy ImageData to the LargeObject

                obj.write(imageObj.getImage(),0,imageObj.getImage().length);

                obj.close();

                PreparedStatement ps = c.prepareStatement("INSERT INTO image VALUES (?, ?, ?, ?,?,?)");

                ps.setInt(1, imageObj.getCameraNumber());

                ps.setInt(2, imageObj.getVideoServerID());

                ps.setLong(3, imageObj.getTimestamp());

                ps.setInt(4, oid);

                ps.setInt(5, imageObj.getExposure());

                ps.setInt(6, imageObj.getGain());

                ps.executeUpdate();

                c.commit();

                ps.close();

                c.setAutoCommit(true);

            } catch(SQLException ex) {

                System.err.println("*SQLException: " + ex.getMessage());

                if (c != null){

                    try {

                        System.err.println("Transaction is being rolled back");

                        c.rollback();

                    } catch (SQLException excep) {

                        System.err.println("**SQLException: " + excep.getMessage());

                    } // end of catch excep

                } // end if c != null

            } // end of catch ex

        } // end of else

    } // end of insertImage()

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe