|
Yes, downloaded it yesterday and still didn't help
;(.
A little bit below is the stack trace of the
execution of the code: As you can see
* I call the getString().
* It in turn calls getCharacterStream (as you
said)
* Which creates an InputStreamReader (<Init>
obviously implies it's in the constructor)
I did a little Java test to do this:
public static void
main(String[] args) {
new InputStreamReader(null);
}
It throws a NullPointerException at the exact same
line in java.io.Reader (line 64).
This means (well to me at least), that the
StreamTranslator.getCharacterStream is constructing a InputStreamReader to get
the data and passing it a "NULL"! They should rather be checking
if (x!=null)
new
InputStreamReader(x)
else
return null;
// cause the data is null
Seems like a bug of some sort to me. Why you
don't get the problem as well, I'm not so sure?
--------- IMPORTANT PART
----------------
Wierd -
2 java.lang.NullPointerException
at
java.io.Reader.<init>(Reader.java:64)
at
java.io.InputStreamReader.<init>(InputStreamReader.java:106)
at
com.sap.dbtech.jdbc.translators.StreamTranslator.getCharacterStream(StreamTranslator.java:89)
at
com.sap.dbtech.jdbc.translators.StreamTranslator.getString(StreamTranslator.java:191)
at
com.sap.dbtech.jdbc.ResultSetSapDB.getString(ResultSetSapDB.java:1179)
--------- IMPORTANT PART STOPS
----------------
at
com.platform_basic.util.jdbc.LightResultSetCreator.createLightResultSet(LightResultSetCreator.java:64)
at
com.platform_basic.util.jdbc.PooledConnection.executeQuery(PooledConnection.java:108)
at
com.platform_basic.util.jdbc.ConnectionPool.executeQueryAgainstPool(ConnectionPool.java:310)
at
com.platform_basic.util.jdbc.ConnectionPool.executeQuery(ConnectionPool.java:270)
at
com.platform_basic.modules.faq.FaqWorker.getGroup(FaqWorker.java:187)
at
com.platform_basic.modules.faq.FaqAdminBean.getGroup(FaqAdminBean.java:74)
at
_0002ffaqgroup_0002ejspfaqgroup_jsp_0._jspService(_0002ffaqgroup_0002ejspfaqgroup_jsp_0.java:204)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at
org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:579)
Kind Regards
Bruce
----- Original Message -----
Sent: Friday, October 19, 2001 9:54
AM
Subject: RE: JDBC problem
Hi
Bruce,
Did
you download the latest PATCH of the JDBC driver? We had some troubles in
using BLOBs and they where resolved by downloading the 7.3.0.0.18 version of
the JDBC driver...
Ivo
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 -----
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
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
------------------------------------------------------------------
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
------------------------------------------------------------------
|