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.

ASA 12 + JDBC4 driver + MyBatis 3 DAO

4 posts in General Discussion Last posting was on 2010-10-29 12:56:56.0Z
Detlef Kriegel Posted on 2010-10-28 17:24:03.0Z
From: "Detlef Kriegel" <d.kriegel.nospam@metrinomics.de>
Newsgroups: ianywhere.public.general
Subject: ASA 12 + JDBC4 driver + MyBatis 3 DAO
Lines: 38
Organization: Metrinomics GmbH
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4cc9b1b3@forums-1-dub>
Date: 28 Oct 2010 10:24:03 -0700
X-Trace: forums-1-dub 1288286643 10.22.241.152 (28 Oct 2010 10:24:03 -0700)
X-Original-Trace: 28 Oct 2010 10:24:03 -0700, vip152.sybase.com
X-Authenticated-User: innsbruck_beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8099
Article PK: 7125

I try to implement a Java Dao for our database, in the most cases without
problems. But in the case of handling with
NClob data I have a poblem, the JDBC driver (sajdbc4.jar) throws an
exception:

Caused by: java.sql.SQLException: Nicht eingerichtet
at sybase.jdbc4.sqlanywhere.IClob.length(IClob.java:269)
at sybase.jdbc4.sqlanywhere.INClob.length(INClob.java:271)
at
de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getNullableResult(IAnywhereNClobTypeHandler.java:112)
at
de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getResult(IAnywhereNClobTypeHandler.java:53)

Here the code:

public Object getNullableResult(ResultSet rs, String columnName) throws
SQLException {
String value = "";
NClob nclob = rs.getNClob(columnName); //<--- this line is ok, data
read
if (nclob != null) {
int size = (int) nclob.length(); //<--- this throws the
exception (not implemented ???)
value = nclob.getSubString(1, size);
}
return value;

For me looks like that the actual driver (12.0.0.2589) don't support
nclob.length(); and nclob.getSubString(long arg0, int arg1);
method. Is this right? Gives for this a workaround?

Thanks
Detlef


Karim Khamis [Sybase iAnywhere] Posted on 2010-10-28 18:17:57.0Z
From: "Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.14) Gecko/20101005 Thunderbird/3.0.9
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: ASA 12 + JDBC4 driver + MyBatis 3 DAO
References: <4cc9b1b3@forums-1-dub>
In-Reply-To: <4cc9b1b3@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: <4cc9be55$2@forums-1-dub>
Date: 28 Oct 2010 11:17:57 -0700
X-Trace: forums-1-dub 1288289877 10.22.241.152 (28 Oct 2010 11:17:57 -0700)
X-Original-Trace: 28 Oct 2010 11:17:57 -0700, vip152.sybase.com
Lines: 47
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8100
Article PK: 7119

Yes, keep in mind that NClob support is optional within the JDBC
specification and the NClob support within the SQL Anywhere JDBC driver
is minimal. You can certainly use the NClob support for performance and
resource reasons, but the length()and getSubString() methods are not
implemented.

Karim

On 10/28/2010 1:24 PM, Detlef Kriegel wrote:
> I try to implement a Java Dao for our database, in the most cases without
> problems. But in the case of handling with
> NClob data I have a poblem, the JDBC driver (sajdbc4.jar) throws an
> exception:
>
> Caused by: java.sql.SQLException: Nicht eingerichtet
> at sybase.jdbc4.sqlanywhere.IClob.length(IClob.java:269)
> at sybase.jdbc4.sqlanywhere.INClob.length(INClob.java:271)
> at
> de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getNullableResult(IAnywhereNClobTypeHandler.java:112)
> at
> de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getResult(IAnywhereNClobTypeHandler.java:53)
>
> Here the code:
>
> public Object getNullableResult(ResultSet rs, String columnName) throws
> SQLException {
> String value = "";
> NClob nclob = rs.getNClob(columnName); //<--- this line is ok, data
> read
> if (nclob != null) {
> int size = (int) nclob.length(); //<--- this throws the
> exception (not implemented ???)
> value = nclob.getSubString(1, size);
> }
> return value;
>
> For me looks like that the actual driver (12.0.0.2589) don't support
> nclob.length(); and nclob.getSubString(long arg0, int arg1);
> method. Is this right? Gives for this a workaround?
>
> Thanks
> Detlef
>
>
>
>
>


Detlef Kriegel Posted on 2010-10-28 18:48:27.0Z
From: "Detlef Kriegel" <d.kriegel.nospam@metrinomics.de>
Newsgroups: ianywhere.public.general
References: <4cc9b1b3@forums-1-dub> <4cc9be55$2@forums-1-dub>
Subject: Re: ASA 12 + JDBC4 driver + MyBatis 3 DAO
Lines: 61
Organization: Metrinomics GmbH
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4cc9c57b$1@forums-1-dub>
Date: 28 Oct 2010 11:48:27 -0700
X-Trace: forums-1-dub 1288291707 10.22.241.152 (28 Oct 2010 11:48:27 -0700)
X-Original-Trace: 28 Oct 2010 11:48:27 -0700, vip152.sybase.com
X-Authenticated-User: innsbruck_beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8101
Article PK: 7121

Thanks for the response. What is the best supported JDBC Datatype for LONG
NVARCHAR columns? Can I used JDBC NVARCHAR data type or will the result
truncated if longer as 32767 NVARCHAR's?

Thanks
Detlef.


"Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com> schrieb im
Newsbeitrag news:4cc9be55$2@forums-1-dub...

> Yes, keep in mind that NClob support is optional within the JDBC
> specification and the NClob support within the SQL Anywhere JDBC driver is
> minimal. You can certainly use the NClob support for performance and
> resource reasons, but the length()and getSubString() methods are not
> implemented.
>
> Karim
> On 10/28/2010 1:24 PM, Detlef Kriegel wrote:
>> I try to implement a Java Dao for our database, in the most cases without
>> problems. But in the case of handling with
>> NClob data I have a poblem, the JDBC driver (sajdbc4.jar) throws an
>> exception:
>>
>> Caused by: java.sql.SQLException: Nicht eingerichtet
>> at sybase.jdbc4.sqlanywhere.IClob.length(IClob.java:269)
>> at sybase.jdbc4.sqlanywhere.INClob.length(INClob.java:271)
>> at
>> de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getNullableResult(IAnywhereNClobTypeHandler.java:112)
>> at
>> de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getResult(IAnywhereNClobTypeHandler.java:53)
>>
>> Here the code:
>>
>> public Object getNullableResult(ResultSet rs, String columnName)
>> throws
>> SQLException {
>> String value = "";
>> NClob nclob = rs.getNClob(columnName); //<--- this line is ok,
>> data
>> read
>> if (nclob != null) {
>> int size = (int) nclob.length(); //<--- this throws the
>> exception (not implemented ???)
>> value = nclob.getSubString(1, size);
>> }
>> return value;
>>
>> For me looks like that the actual driver (12.0.0.2589) don't support
>> nclob.length(); and nclob.getSubString(long arg0, int arg1);
>> method. Is this right? Gives for this a workaround?
>>
>> Thanks
>> Detlef
>>
>>
>>
>>
>>
>


Karim Khamis [Sybase iAnywhere] Posted on 2010-10-29 12:56:56.0Z
From: "Karim Khamis [Sybase iAnywhere]" <kkhamis@sybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.14) Gecko/20101005 Thunderbird/3.0.9
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: ASA 12 + JDBC4 driver + MyBatis 3 DAO
References: <4cc9b1b3@forums-1-dub> <4cc9be55$2@forums-1-dub> <4cc9c57b$1@forums-1-dub>
In-Reply-To: <4cc9c57b$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: <4ccac498$1@forums-1-dub>
Date: 29 Oct 2010 05:56:56 -0700
X-Trace: forums-1-dub 1288357016 10.22.241.152 (29 Oct 2010 05:56:56 -0700)
X-Original-Trace: 29 Oct 2010 05:56:56 -0700, vip152.sybase.com
Lines: 66
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8102
Article PK: 7120

You should be fine with using getCharacterStream().

Karim

On 10/28/2010 2:48 PM, Detlef Kriegel wrote:
> Thanks for the response. What is the best supported JDBC Datatype for LONG
> NVARCHAR columns? Can I used JDBC NVARCHAR data type or will the result
> truncated if longer as 32767 NVARCHAR's?
>
> Thanks
> Detlef.
>
>
> "Karim Khamis [Sybase iAnywhere]"<kkhamis@sybase.com> schrieb im
> Newsbeitrag news:4cc9be55$2@forums-1-dub...
>> Yes, keep in mind that NClob support is optional within the JDBC
>> specification and the NClob support within the SQL Anywhere JDBC driver is
>> minimal. You can certainly use the NClob support for performance and
>> resource reasons, but the length()and getSubString() methods are not
>> implemented.
>>
>> Karim
>> On 10/28/2010 1:24 PM, Detlef Kriegel wrote:
>>> I try to implement a Java Dao for our database, in the most cases without
>>> problems. But in the case of handling with
>>> NClob data I have a poblem, the JDBC driver (sajdbc4.jar) throws an
>>> exception:
>>>
>>> Caused by: java.sql.SQLException: Nicht eingerichtet
>>> at sybase.jdbc4.sqlanywhere.IClob.length(IClob.java:269)
>>> at sybase.jdbc4.sqlanywhere.INClob.length(INClob.java:271)
>>> at
>>> de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getNullableResult(IAnywhereNClobTypeHandler.java:112)
>>> at
>>> de.metrinomics.dao3.typehandler.IAnywhereNClobTypeHandler.getResult(IAnywhereNClobTypeHandler.java:53)
>>>
>>> Here the code:
>>>
>>> public Object getNullableResult(ResultSet rs, String columnName)
>>> throws
>>> SQLException {
>>> String value = "";
>>> NClob nclob = rs.getNClob(columnName); //<--- this line is ok,
>>> data
>>> read
>>> if (nclob != null) {
>>> int size = (int) nclob.length(); //<--- this throws the
>>> exception (not implemented ???)
>>> value = nclob.getSubString(1, size);
>>> }
>>> return value;
>>>
>>> For me looks like that the actual driver (12.0.0.2589) don't support
>>> nclob.length(); and nclob.getSubString(long arg0, int arg1);
>>> method. Is this right? Gives for this a workaround?
>>>
>>> Thanks
>>> Detlef
>>>
>>>
>>>
>>>
>>>
>>
>
>