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.

Is there a way to do multiple getBytes calls to an IBlob object?

5 posts in General Discussion Last posting was on 2009-04-10 01:41:51.0Z
Bill Williams Posted on 2009-04-09 18:00:42.0Z
From: "Bill Williams" <billwilliams@qcsoftware.com>
Newsgroups: ianywhere.public.general
Subject: Is there a way to do multiple getBytes calls to an IBlob object?
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49de37ca$1@forums-1-dub>
Date: 9 Apr 2009 11:00:42 -0700
X-Trace: forums-1-dub 1239300042 10.22.241.152 (9 Apr 2009 11:00:42 -0700)
X-Original-Trace: 9 Apr 2009 11:00:42 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7501
Article PK: 5913

We have a standard way of dealing with certain datatypes and one thing we do
is have a conversion routine that will convert database object into other
objects so we can always deal with a single type of object. This way, our
code does not have to know which kind of database and JDBC connection it is
using. In this particular instance, we convert data that would be in a long
binary into a ByteArrayInputStream. When dealing with jConnect, this data
looks like a simple byte array; however, in iAnywhere, it appears this is an
IBlob object.

I have discovered once I do the getBytes method in the IBlob object, if I
try to do it again, I basically get null back because it looks like we have
consumed the bytes from the object.

Is there a way to reset the object to the getBytes will work again? This is
the reason I asked in an earlier post about the documentation. Apparently
IBlob implement Blob but since I cannot find any documentation regarding the
specific classes in the jodbc.jar file, I don't know what kind of other
options I may have.

Thanks


Karim Khamis [Sybase iAnywhere] Posted on 2009-04-09 19:26:42.0Z
From: "Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Is there a way to do multiple getBytes calls to an IBlob object?
References: <49de37ca$1@forums-1-dub>
In-Reply-To: <49de37ca$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49de4bf2$1@forums-1-dub>
Date: 9 Apr 2009 12:26:42 -0700
X-Trace: forums-1-dub 1239305202 10.22.241.152 (9 Apr 2009 12:26:42 -0700)
X-Original-Trace: 9 Apr 2009 12:26:42 -0700, vip152.sybase.com
Lines: 41
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7502
Article PK: 5914

Bill,

Sadly the IBlob implementation although very useful in terms of flow
control is a one shot deal. The blob can only be read sequentially from
the beginning (i.e. you cannot scroll to any position in the blob and
start reading from that point), and once the blob bytes are consumed you
are done. You cannot reset the blob position to the beginning and start
reading again. Having said that you might be able to use one of the java
Steam implementation to build a cached stream on top of the
InputStream that gets returned from IBlob.getBinaryStream.

Now, as an aside, jConnect does not have an implementation for
getBlob(), so I am guessing you are getting the blob as a result of a
call to getObject(). If that is the case, you might want to consider
making an explicit call to ResultSet.getBinaryStream() for long binary
data instead of calling getObject() and getting a blob.

Karim

Bill Williams wrote:
> We have a standard way of dealing with certain datatypes and one thing we do
> is have a conversion routine that will convert database object into other
> objects so we can always deal with a single type of object. This way, our
> code does not have to know which kind of database and JDBC connection it is
> using. In this particular instance, we convert data that would be in a long
> binary into a ByteArrayInputStream. When dealing with jConnect, this data
> looks like a simple byte array; however, in iAnywhere, it appears this is an
> IBlob object.
>
> I have discovered once I do the getBytes method in the IBlob object, if I
> try to do it again, I basically get null back because it looks like we have
> consumed the bytes from the object.
>
> Is there a way to reset the object to the getBytes will work again? This is
> the reason I asked in an earlier post about the documentation. Apparently
> IBlob implement Blob but since I cannot find any documentation regarding the
> specific classes in the jodbc.jar file, I don't know what kind of other
> options I may have.
>
> Thanks
>
>


Bill Williams Posted on 2009-04-09 19:46:34.0Z
From: "Bill Williams" <billwilliams@qcsoftware.com>
Newsgroups: ianywhere.public.general
References: <49de37ca$1@forums-1-dub> <49de4bf2$1@forums-1-dub>
Subject: Re: Is there a way to do multiple getBytes calls to an IBlob object?
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49de509a@forums-1-dub>
Date: 9 Apr 2009 12:46:34 -0700
X-Trace: forums-1-dub 1239306394 10.22.241.152 (9 Apr 2009 12:46:34 -0700)
X-Original-Trace: 9 Apr 2009 12:46:34 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7503
Article PK: 5916

Thanks for the info.

I suppose there is not documentation regarding the various classes in
jodbc.jar is there?

"Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com> wrote in message
news:49de4bf2$1@forums-1-dub...
> Bill,
>
> Sadly the IBlob implementation although very useful in terms of flow
> control is a one shot deal. The blob can only be read sequentially from
> the beginning (i.e. you cannot scroll to any position in the blob and
> start reading from that point), and once the blob bytes are consumed you
> are done. You cannot reset the blob position to the beginning and start
> reading again. Having said that you might be able to use one of the java
> Steam implementation to build a cached stream on top of the InputStream
> that gets returned from IBlob.getBinaryStream.
>
> Now, as an aside, jConnect does not have an implementation for getBlob(),
> so I am guessing you are getting the blob as a result of a call to
> getObject(). If that is the case, you might want to consider making an
> explicit call to ResultSet.getBinaryStream() for long binary data instead
> of calling getObject() and getting a blob.
>
> Karim
> Bill Williams wrote:
>> We have a standard way of dealing with certain datatypes and one thing we
>> do is have a conversion routine that will convert database object into
>> other objects so we can always deal with a single type of object. This
>> way, our code does not have to know which kind of database and JDBC
>> connection it is using. In this particular instance, we convert data
>> that would be in a long binary into a ByteArrayInputStream. When dealing
>> with jConnect, this data looks like a simple byte array; however, in
>> iAnywhere, it appears this is an IBlob object.
>>
>> I have discovered once I do the getBytes method in the IBlob object, if I
>> try to do it again, I basically get null back because it looks like we
>> have consumed the bytes from the object.
>>
>> Is there a way to reset the object to the getBytes will work again? This
>> is the reason I asked in an earlier post about the documentation.
>> Apparently IBlob implement Blob but since I cannot find any documentation
>> regarding the specific classes in the jodbc.jar file, I don't know what
>> kind of other options I may have.
>>
>> Thanks
>>


Karim Khamis [Sybase iAnywhere] Posted on 2009-04-09 19:51:47.0Z
From: "Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Is there a way to do multiple getBytes calls to an IBlob object?
References: <49de37ca$1@forums-1-dub> <49de4bf2$1@forums-1-dub> <49de509a@forums-1-dub>
In-Reply-To: <49de509a@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49de51d3$1@forums-1-dub>
Date: 9 Apr 2009 12:51:47 -0700
X-Trace: forums-1-dub 1239306707 10.22.241.152 (9 Apr 2009 12:51:47 -0700)
X-Original-Trace: 9 Apr 2009 12:51:47 -0700, vip152.sybase.com
Lines: 53
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7504
Article PK: 5915

No, there is no specific documentation on the iAnywhere JDBC driver
classes. I will submit an enhancement request to the documentation team.

Karim

Bill Williams wrote:
> Thanks for the info.
>
> I suppose there is not documentation regarding the various classes in
> jodbc.jar is there?
>
> "Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com> wrote in message
> news:49de4bf2$1@forums-1-dub...
>> Bill,
>>
>> Sadly the IBlob implementation although very useful in terms of flow
>> control is a one shot deal. The blob can only be read sequentially from
>> the beginning (i.e. you cannot scroll to any position in the blob and
>> start reading from that point), and once the blob bytes are consumed you
>> are done. You cannot reset the blob position to the beginning and start
>> reading again. Having said that you might be able to use one of the java
>> Steam implementation to build a cached stream on top of the InputStream
>> that gets returned from IBlob.getBinaryStream.
>>
>> Now, as an aside, jConnect does not have an implementation for getBlob(),
>> so I am guessing you are getting the blob as a result of a call to
>> getObject(). If that is the case, you might want to consider making an
>> explicit call to ResultSet.getBinaryStream() for long binary data instead
>> of calling getObject() and getting a blob.
>>
>> Karim
>> Bill Williams wrote:
>>> We have a standard way of dealing with certain datatypes and one thing we
>>> do is have a conversion routine that will convert database object into
>>> other objects so we can always deal with a single type of object. This
>>> way, our code does not have to know which kind of database and JDBC
>>> connection it is using. In this particular instance, we convert data
>>> that would be in a long binary into a ByteArrayInputStream. When dealing
>>> with jConnect, this data looks like a simple byte array; however, in
>>> iAnywhere, it appears this is an IBlob object.
>>>
>>> I have discovered once I do the getBytes method in the IBlob object, if I
>>> try to do it again, I basically get null back because it looks like we
>>> have consumed the bytes from the object.
>>>
>>> Is there a way to reset the object to the getBytes will work again? This
>>> is the reason I asked in an earlier post about the documentation.
>>> Apparently IBlob implement Blob but since I cannot find any documentation
>>> regarding the specific classes in the jodbc.jar file, I don't know what
>>> kind of other options I may have.
>>>
>>> Thanks
>>>
>


Bill Williams Posted on 2009-04-10 01:41:51.0Z
From: "Bill Williams" <billwilliams@qcsoftware.com>
Newsgroups: ianywhere.public.general
References: <49de37ca$1@forums-1-dub> <49de4bf2$1@forums-1-dub> <49de509a@forums-1-dub> <49de51d3$1@forums-1-dub>
Subject: Re: Is there a way to do multiple getBytes calls to an IBlob object?
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49dea3df@forums-1-dub>
Date: 9 Apr 2009 18:41:51 -0700
X-Trace: forums-1-dub 1239327711 10.22.241.152 (9 Apr 2009 18:41:51 -0700)
X-Original-Trace: 9 Apr 2009 18:41:51 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7505
Article PK: 5919

Thanks

"Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com> wrote in message
news:49de51d3$1@forums-1-dub...
> No, there is no specific documentation on the iAnywhere JDBC driver
> classes. I will submit an enhancement request to the documentation team.
>
> Karim
> Bill Williams wrote:
>> Thanks for the info.
>>
>> I suppose there is not documentation regarding the various classes in
>> jodbc.jar is there?
>>
>> "Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com> wrote in message
>> news:49de4bf2$1@forums-1-dub...
>>> Bill,
>>>
>>> Sadly the IBlob implementation although very useful in terms of flow
>>> control is a one shot deal. The blob can only be read sequentially from
>>> the beginning (i.e. you cannot scroll to any position in the blob and
>>> start reading from that point), and once the blob bytes are consumed you
>>> are done. You cannot reset the blob position to the beginning and start
>>> reading again. Having said that you might be able to use one of the java
>>> Steam implementation to build a cached stream on top of the InputStream
>>> that gets returned from IBlob.getBinaryStream.
>>>
>>> Now, as an aside, jConnect does not have an implementation for
>>> getBlob(), so I am guessing you are getting the blob as a result of a
>>> call to getObject(). If that is the case, you might want to consider
>>> making an explicit call to ResultSet.getBinaryStream() for long binary
>>> data instead of calling getObject() and getting a blob.
>>>
>>> Karim
>>> Bill Williams wrote:
>>>> We have a standard way of dealing with certain datatypes and one thing
>>>> we do is have a conversion routine that will convert database object
>>>> into other objects so we can always deal with a single type of object.
>>>> This way, our code does not have to know which kind of database and
>>>> JDBC connection it is using. In this particular instance, we convert
>>>> data that would be in a long binary into a ByteArrayInputStream. When
>>>> dealing with jConnect, this data looks like a simple byte array;
>>>> however, in iAnywhere, it appears this is an IBlob object.
>>>>
>>>> I have discovered once I do the getBytes method in the IBlob object, if
>>>> I try to do it again, I basically get null back because it looks like
>>>> we have consumed the bytes from the object.
>>>>
>>>> Is there a way to reset the object to the getBytes will work again?
>>>> This is the reason I asked in an earlier post about the documentation.
>>>> Apparently IBlob implement Blob but since I cannot find any
>>>> documentation regarding the specific classes in the jodbc.jar file, I
>>>> don't know what kind of other options I may have.
>>>>
>>>> Thanks
>>>>
>>