Bruce,
����������� Thanks for your help.� I did just find the solution.� The
problem is
�
���� String data = Result.getString(col);
�
����������� For Long Varchars on this particular database, the
getString() function did not return the value if it were just 1 char.�
Very strange, but the solution was to use getAsciiStream() if it was a
long varchar.� IE:
��
� String data = ��;
� If(ResultData.getColumnTypeName(col).compareTo(�long varchar�)==0) {
��� StringBuffer s = new StringBuffer();
��� byte[] buff = new byte[4096];
��� java.io.InputStream fin = Result.getAsciiStream(col);
��� for(;;) {
����� int size = fin.read(buff);
����� if(size = = -1)
������� break;
����� s.append(new String(buff,0,size));
��� }
��� data = s.toString();
� } else {
��� data = Result.getString(col);
� }
�
�
-----Original Message-----
�Behalf Of Dunwiddie, Bruce
�
look at the code above this block to see what NumColumns is when there's
only 1 column. my bet is that somehow for some reason, it's being set to
0.
-----Original Message-----
From: Charles Conover [mailto:[EMAIL PROTECTED]]
Hello,
����������� I am using Sybase ASA V7.03 using a servlet with JDK1.3
(6/2/2000).� This servlet has been in production for over a year and I
just found that if I am grabbing a resultset that has a long varchar
(BLOB) with only 1 char in the field, I get back no data.� If the field
has 2 chars or more, then no problem, but 1 char returns no data.�
Regular char and varchar fields seem to work fine.
����������� The code is pretty simple:
�
for(int col=1;col <= NumColumns; col++)
� try {
��� String data = Result.getString(col);
// data is empty string here under conditions stated above
� ColumnDataHash.put(ColumnNames[col - 1].toLowerCase(),data);
�} catch(Exception e) {
� // error stuff here
�}
�
Anyone seen anything like this?
Thanks,
Chuck

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to