This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Servlets and the fly likes dbConnectionBroker in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "dbConnectionBroker in JSP" Watch "dbConnectionBroker in JSP" New topic

dbConnectionBroker in JSP

miguel lara

Joined: May 25, 2001
Posts: 2
Hi Frank & everybody,
We're using dbConnectionBroker inside a JSP program, the way we're declaring it is:
static DbConnectionBroker mydb = null;
catch(Exception e)
Then the program is working just fine for some time but all of a sudden we start getting the Error 500: java.lang.NullPointerException
If we recompile the program works fine for a while again. is it any other way to use dbConnectionBroker from a JSP page? I will really appreciate your help!
[This message has been edited by miguel lara (edited June 12, 2001).]
[This message has been edited by miguel lara (edited June 12, 2001).]
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
don't know why you are getting nullpointerexception.
Probably you can write a class for Database management.
and use it as a bean with "application" scope.
well try using the servlet-centric design process for doing web applications. It's highly recommended by sun.
Avoid having database related operations in the jsp.
use it only for presentation. Keep business logic in Business classes. Let the database related stuff go on there.
Basically you will have a master servlet deciding which business methods need to be called and there will be n number of jsps to do presentation work.

I agree. Here's the link:
subject: dbConnectionBroker in JSP
It's not a secret anymore!