This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dbConnectionBroker in JSP

 
miguel lara
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic