Bean to bean communication
Posted on 2003-03-23
I am running a JSP web application which displays data from a mySQL database. I have developed a collection of Beans to take care of a lot of the calculations, databaseaccess and so on.
Fx. I have a DatabaseBean with the method :
ResultSet executeQuery(String query, String username, String password)
I can then from the JSP use this method like this:
ResultSet rs = DatabaseBean.executeQuery("Select username from user where userID=3","myname","mypw");
I would very much like to be able to let the beans communicate with each other, but I don't know how! Fx. it would be nice to use the allready written DatabaseBean-methods in my other beans, or just to exchange variables between beans.
At the moment I can only make beans communicate via the jsp-pages, and it is troublesome!
Can you help?