wood burning stoves*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "dbConnectionBroker in JSP" Watch "dbConnectionBroker in JSP" New topic
Author

dbConnectionBroker in JSP

miguel lara
Greenhorn

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;
static
{try
{ mydb = new DbConnectionBroker(DRIVER, URL, USER, PASSWORD, MINCONNS, MAXCONNS, LOG, CLEANUP);
}
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!
Thanks.
Miguel
[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.
karthik.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dbConnectionBroker in JSP
 
Similar Threads
cleared scjp
Problem in simulteneous access to the same servlet
cleared scjp
Zero fill right shift ">>>"
Place Association