I use getString.  Below is the code...it outputs "wierd" with the index of the Long. When i used the same code on a MS SQL Server 7 database there where no problems with the exact same db structure! 
 
----- Cut ---------
   for ( int i = 0; i < cn; i++ )
   {
    try
    {
     tempS[i] = rs.getString ( i + 1 );
    } catch (NullPointerException e)
    {
     System.out.println( "Wierd - " + (i + 1) );
     tempS[i] = null;
    }
   }
--------End Cut ---------
 
Do you think maybe the problem might be that in my database the question field (i.e. the Long) is set to NOT NULL.  Maybe the driver makes some kind of optimisation where if it sees a field is NOT NULL is doesn't consider that the data could be NULL (as it is in an outer join).  Maybe in your db its set to allows NULL?  And hence maybe does some extra checks???
 
It might be a problem specifically surrounding outer joins in conjunction with non-nullable Longs?
 
Kind Regards
Bruce
 
----- Original Message -----
From: Ivo Limmen
Sent: Friday, October 19, 2001 9:31 AM
Subject: RE: JDBC problem

Hi Bruce,
 
Do you use the getCharacterStream(), getString() or something else? I personally use the getString() to access the Longs in the database and it works fine...
it simply returns a 'null' value if the Long in the database is empty.
 
Ivo
-----Original Message-----
From: Bruce Lowe [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 19 oktober 2001 9:13
To: [EMAIL PROTECTED]
Subject: JDBC problem

Hi All
 
I'm trying the below query which seems to always execute fine while in the SAP SQL studio.
 
SELECT fg.faq_group_description, 
  fq.question,  
  fq.faq_question_number
FROM faq_group fg,  
  faq_question fq  
WHERE fq.faq_group_number (+) = fg.faq_group_number
AND     fg.faq_group_number = 305
 
However the problem comes in, in my Java program (which uses the latest JDBC driver to connect), under a condition that there are no questions for the FAQ Group
 
(i.e. some example of a result is shown below when this happens)
 
(varchar)    (Long)    (Integer)
ABC        ?            ?
 
If there is a null in a "Long" field (field of unlimited acsii values), then the JDBCDriver seems to throw some kind of NullPointer exception because its created a java.io.Reader to read something thats not there!!  This seems to be a bug in the driver.  I can catch the Exception and assume the data is null, but it seems strange it only happens on Longs. 
 
I was wondering if anyone has heard of this bug and knows when/if it might be fixed?
 
Kind Regards
Bruce
 
 
 
 


Furore B.V.

Rijswijkstraat 175-8

Postbus 9204

1006 AE Amsterdam

tel. (020) 346 71 71

fax. (020) 346 71 77


------------------------------------------------------------------

The information transmitted is intended only for the person

or entity to which it is addressed and may contain confidential

and/or privileged material. Any review, retransmission,

dissemination or other use of, or taking of any action in

reliance upon, this information by persons or entities other

than the intended recipient is prohibited. If you received

this in error, please contact the sender and delete the material

from any computer

------------------------------------------------------------------


Reply via email to