To access DB in Struts (and elsewhere) there is a Wiki page:

http://wiki.apache.org/struts/DaoRelated

So... anyone that wants to help people w/DAO can add to it.
.V

Jim Douglas wrote:

I have an LogonForm, LogonAction and when a user successfully logs on, I set Attributes for "userID" and "userName".

How would be the best way to make this information available to the Web App regardless of whether I need the data from within a JSP, servlet or class file(for example, building a dynamic query)

This is what I was trying to do and raised this issue(I can't get it to work)

public class SQL92FormDetailDAO implements FormDetailDAO {

    private Connection connection;
    public SQL92FormDetailDAO(Connection connection) {
        this.connection = connection;
    }

    public List listFormDetail() {
        List items = new ArrayList();
        Statement statement =null;
        try {
            statement = connection.createStatement();
                String userID = session.getAttribute("userID");
                       String query = "select name, formdetail  from "
                           + "forms where userID = " + userID;


Thanks, Jim



-- RiA-SoA w/JDNC <http://www.SandraSF.com> forums - help develop a community My blog <http://www.sandrasf.com/adminBlog>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to