You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2002/03/01 14:50:32 UTC
RE: Problem with Tomcat or Servlet?
Since Tomcat knows nothing about MySQL (or your database in
particular), I would be willing to be that you have a problem in your code.
You probably want to look at the line where the NullPointer is being thrown.
A random guess - you only create your Connection or Statement object
when you create a new record and not for select.
Randy
> -----Original Message-----
> From: Stephan Mülhaus [mailto:smu@nwu.net]
> Sent: Friday, March 01, 2002 9:28 AM
> To: Tomcat Users List
> Subject: Problem with Tomcat or Servlet?
>
>
> Hi everybody,
>
> i have a strange Problem, i have developed a servlet in which
> i can create
> new records in a mysql database and where i can list these
> records in a
> htmlpage.
> Now the strange behaviour:
> If i try to get the list of records Tomcat throws an
> NullPointerException
> although the source is okay but if i create a new record and
> let my servlet
> list all my records it shows me all my records!
> I couldn't find any strange entries in my logfiles,
> everything is normal...
> Now, perhaps you can help me, is this a problem of my servlet
> or a problem
> of my tomcat?
>
> Thanx in Advance
> Stephan
>
>
> --
> To unsubscribe: <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: Problem with Tomcat or Servlet?
Posted by Stephan Mülhaus <sm...@nwu.net>.
No, i don't allow any nulls in my fields.
Stephan
At 08:43 01.03.2002 -0600, you wrote:
> > A random guess - you only create your Connection or Statement object
> > when you create a new record and not for select.
>
>Another guess...
>Do you have fields in your table(s) which allow nulls? If so, the result
>set will return a null when you get the contents of one of these fields and
>the field in the current row is null.
>
>Jim
>
>
>--
>To unsubscribe: <ma...@jakarta.apache.org>
>For additional commands: <ma...@jakarta.apache.org>
>Troubles with the list: <ma...@jakarta.apache.org>
--
----------------------------------------------------------------------------------------------
Stephan Mülhaus smu@nwu.net
NWU Gesellschaft fuer Netzwerk und Kommunikation mbH
Phone: +49-231-986510 - 0
FAX: +49-231-986522 - 2
----------------------------------------------------------------------------------------------
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: Problem with Tomcat or Servlet?
Posted by Jim Urban <ji...@netsteps.net>.
> A random guess - you only create your Connection or Statement object
> when you create a new record and not for select.
Another guess...
Do you have fields in your table(s) which allow nulls? If so, the result
set will return a null when you get the contents of one of these fields and
the field in the current row is null.
Jim
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: Problem with Tomcat or Servlet?
Posted by Stephan Mülhaus <sm...@nwu.net>.
Well, i don't get any linenumbers where the problem occurs...
No, my Connection is correct, i made this in several servlet and i don't
have any problems with them.
>Since Tomcat knows nothing about MySQL (or your database in
>particular), I would be willing to be that you have a problem in your code.
>You probably want to look at the line where the NullPointer is being thrown.
>
>A random guess - you only create your Connection or Statement object
>when you create a new record and not for select.
>
>Randy
> > -----Original Message-----
> > From: Stephan Mülhaus [mailto:smu@nwu.net]
> > Sent: Friday, March 01, 2002 9:28 AM
> > To: Tomcat Users List
> > Subject: Problem with Tomcat or Servlet?
> >
> >
> > Hi everybody,
> >
> > i have a strange Problem, i have developed a servlet in which
> > i can create
> > new records in a mysql database and where i can list these
> > records in a
> > htmlpage.
> > Now the strange behaviour:
> > If i try to get the list of records Tomcat throws an
> > NullPointerException
> > although the source is okay but if i create a new record and
> > let my servlet
> > list all my records it shows me all my records!
> > I couldn't find any strange entries in my logfiles,
> > everything is normal...
> > Now, perhaps you can help me, is this a problem of my servlet
> > or a problem
> > of my tomcat?
> >
> > Thanx in Advance
> > Stephan
> >
> >
> > --
> > To unsubscribe: <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>--
>To unsubscribe: <ma...@jakarta.apache.org>
>For additional commands: <ma...@jakarta.apache.org>
>Troubles with the list: <ma...@jakarta.apache.org>
--
----------------------------------------------------------------------------------------------
Stephan Mülhaus smu@nwu.net
NWU Gesellschaft fuer Netzwerk und Kommunikation mbH
Phone: +49-231-986510 - 0
FAX: +49-231-986522 - 2
----------------------------------------------------------------------------------------------
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>