dcsimg
writing and reading blob
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Erin_Walter
Posted On:   Wednesday, October 17, 2001 01:15 PM

Here is my problem...I have been working on this for 2 weeks and the dealine is fast approching. I need help!! My problem is that I need to insert a blob into Oracle then after the insert a trigger fires which calls a stored procedure, which call my java code. Now, I insert the blob as follows: the blob is being inserted as follows: ); INSERT INTO The_Table values( utl_raw.concat('11111111111111111111111111111111111111111111111111111111111111111111111111111111', '11111111111111111111111111111111111111111111111111111111111111111111111111111111', '11111111111111111111111111111111111111111111111111111111111111111111111111111111', '111111111111111111111111111111111111111111111111   More>>

Here is my problem...I have been working on this for 2 weeks and the dealine is fast approching. I need help!!

My problem is that I need to insert a blob
into Oracle then after the insert a trigger fires which calls
a stored procedure, which call my java code.
Now, I insert the blob as follows:

the blob is being inserted as follows: );
INSERT INTO The_Table values(
utl_raw.concat('11111111111111111111111111111111111111111111111111111111111111111111111111111111',
'11111111111111111111111111111111111111111111111111111111111111111111111111111111',
'11111111111111111111111111111111111111111111111111111111111111111111111111111111',
'11111111111111111111111111111111111111111111111111111111111111111111111111111111',
'11111111111111111111111111111111111111111111111111111111111111111111111111111111'));

When I get to the Java code I am
performing
blob.length() and blob.getBytes() on
the blob that I pass, it does not
turn out correct. It gives the
incorrect length, it is MUCH smaller,
and incorrect amount of Bytes...
I thought it would take each
group of 8 bits and
put it into a byte, but, it is not
doing that. I can do it if I put in like
'Hello World' but, not if I put in
a string of bits. How do I deal with a string
of bits?

Questions:
1. How exactly does it split
it into bytes and get the length?

2. Am I inserting it incorrectly for
the java.sql.blob functions to handle
it?

3. Does anyone know how I do this from start to finish,
including dealing with a big string of bits?

   <<Less
About | Sitemap | Contact