Hi, I am a beginner learning about java language and netbeans, and have a few questions I would like to ask. I want to create a new JSP page to allow a user to add new attributes/items, or to update the attributes in a database/table that I already have. How should I go around doing that? I already have dragged a table to the new JSP page, and dragged my database/table to the table on that page, and when I run that page on the web browser, my table appears. Am i supposed to create a button that allows the user to add new attributes, and key in some coding in the button?


I already have figured out how to insert attributes to a table in the web browser, but I can't save the new attributes. This is how my coding for the save button looks like,

public String save_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        try {

           if (instancedataDataProvider.getRowCount() > 0) {
                           (new Integer(0))) {
                               new Integer(newInstanceID));

                               (new Integer(0))) {
                                   new Integer(newInstanceName));

               } while (instancedataDataProvider.cursorNext());
        } catch (Exception ex) {
            log("Error Description", ex);
            error("Error :+ex.getMessage()");

        return null;

I know the code has some errors, but I do not know where and how to start solving the errors.

Help will be greatly appreciated, thanks so much.

This article has been dead for over six months. Start a new discussion instead.