Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Update attached file to database

2 posts in EJB Client Last posting was on 2005-03-18 08:19:04.0Z
John Posted on 2005-03-17 16:36:25.0Z
Sender: 407d.4239b14f.1804289383@sybase.com
From: John
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Update attached file to database
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4239b209.40f1.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Mar 2005 08:36:25 -0800
X-Trace: forums-1-dub 1111077385 10.22.241.41 (17 Mar 2005 08:36:25 -0800)
X-Original-Trace: 17 Mar 2005 08:36:25 -0800, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:459
Article PK: 424631

I have a table with 'text' (datatype) column. I know I can
use setblob in powerbuilder code But how to insert the
attached file to table by java code?

Thanks,
John


Bede <bede_nosp Posted on 2005-03-18 08:19:04.0Z
From: Bede <bede_nosp@m_sofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Update attached file to database
Message-ID: <MPG.1ca4ad60c5e854bf9896e0@forums.sybase.com>
References: <4239b209.40f1.1681692777@sybase.com>
Organization: Sofico
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Date: 18 Mar 2005 00:19:04 -0800
X-Trace: forums-1-dub 1111133944 194.7.38.226 (18 Mar 2005 00:19:04 -0800)
X-Original-Trace: 18 Mar 2005 00:19:04 -0800, uu194-7-38-226.unknown.uunet.be
Lines: 28
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:461
Article PK: 424628

we had a similar problem.. Problem is that a BLOB in PB is an int[] in
java and PB does not provide any functionality to convert between these
2 types.
Sybase supports gives a solution by reading a file into a int[] (using
API) but that is crappy 'coz fileClose doesn't work properly and there's
another problem with unicode/non-unicode sets.

Still, there's an easy way to do this. Code the functionality in java
(reading/writing a file) and call that from PB. You'll you code this on
a java class that gets through to PB (ejb2pb90.exe) as a proxy.

Once you get it in the java class, it shouldn't be a problem to transfer
it to a blob-col in a table (using java again)

As always, if not available in PB, code it somewhere else!

HTH,

Ben

In article <4239b209.40f1.1681692777@sybase.com>, John says...

> I have a table with 'text' (datatype) column. I know I can
> use setblob in powerbuilder code But how to insert the
> attached file to table by java code?
>
> Thanks,
> John
>