Path: news.easynews.com!easynews!sjc-peer.news.verio.net!news.verio.net!sn-xit-01!sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
From: emwalter@engin.umich.edu (Erin Walter)
Newsgroups: comp.databases.oracle.misc
Subject: using trigger->stored proc -> Java...blob is empty
Date: 10 Oct 2001 12:23:56 -0700
Organization: http://groups.google.com/
Lines: 67
Message-ID: <f73db37a.0110101123.4a11b085@posting.google.com>
NNTP-Posting-Host: 141.212.196.222
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1002741837 12453 127.0.0.1 (10 Oct 2001 19:23:57 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 10 Oct 2001 19:23:57 GMT
Xref: easynews comp.databases.oracle.misc:70143
X-Received-Date: Wed, 10 Oct 2001 12:23:41 MST (news.easynews.com)

So, I am having a big problem.  The problem is that I created a
trigger that fires after a insert into a table.  That trigger then
calls a stored procedure which then refers to some Java code, please
refer to code below for more information.  My problem is that when the
blob comes into the Java code the length of the blob is 0 and I can
not get any information out of it ...even though there is data in the
blob in the database.  I REALLY need some help....I have been stuck
for 3 days and asked everyone, including Oracle...if you know
anything..PLEASE HELP!!!

The code:

I have a trigger that happends after an insert into a table. The
trigger is:

  BEGIN
  	IF (:new.nReplacedID > 0) THEN
  	Replaced_Packet(:new.nOriginalPacketID, :new.nLoadID,
  	:new.tSCETTime, :new.nPacketType, :new.sChannel, :new.nReplacedID,
  	:new.oPacket);
  ELSE
  	New_Packet(:new.nOriginalPacketID, :new.nLoadID,
  	:new.tSCETTime, :new.nPacketType, :new.sChannel, :new.nReplacedID,
  	:new.oPacket);
  	END IF;
  END;

  Here's the stored Procedure:

  (nPacketID NUMBER, nLoadID NUMBER, tSCETTime DATE, nPacketType
NUMBER,
  sChannel CHAR, nReplacedID NUMBER, oPacket BLOB)
  AS LANGUAGE JAVA NAME
  'Expand.Packet(int, int, java.sql.Date, int, java.lang.String, int,
  java.sql.Blob)';

  Here the beginning of the Java code:
  import java.io.*;
  import java.sql.*;
  import java.lang.*;
  import oracle.jdbc.driver.*;
  import oracle.jdbc.*;
  public class Expand
  {
  //*****************************************************************
  //*****************************************************************
  //***********************Packet********************************
  //Summary: This function is called when it is a new packet.
  //*****************************************************************
  //****************************************************************
  public static void Packet(int nOriginalPacketID, int nLoadID,
  java.sql.Date tSCETTime, int nPacketType, String sChannel, int
  nReplacedID, java.sql.Blob oPacket)
  {
  	int fill_in;
  	java.sql.Connection conn;
  	System.out.println("beginning");
  	try{
  		conn = new OracleDriver().defaultConnection();
  		long nblobLength = oPacket.length();//the length of the blob
  		System.out.println("the blob length is "+ nblobLength);
  		System.out.println("after");
  	}catch(SQL Exception e){}
  }//end of the function
  }//end of the class

ANY HELP would be appreciated!!!  Thank you for your time!
