Storing session variables into a Database JSP

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Storing session variables into a Database JSP

    I have a form page that users fillout for a online ad
    Once completed, they hit "Preview Ad" to view the information that they just entered on the next page in simple text format (no forms on this page)
    Then they hit submit on the third page to insert the previewed data into a database (but that's my problem)

    Here is my question, do I set session variables to store the form data form the first page so that once they view it on the second page and hit submit, I can insert all that form data from the first page into a database? And if this is how to do it, how do set the JSP code to insert a session variable into a database?

    I appreciate any help on this.


    JSPballerzz webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Database Storing
      I have created and asp form and connected to a sql database on dw. What is the next step for getting the submit button to store the form info in the...
    2. Storing Variables in html???
      I would like build an html page structure and have a Flash navigation. So for reasons of easier updating and building, I would like to have only...
    3. Storing variables in text files?
      Hi I'm trying to export variables to a text file, so that the user's settings can be reloaded when restarting the program. Is this possible?
    4. Storing .doc and .pdf in database
      Is anyone know how I can store Word Docs and PDF's in database, and how I can make link for visitor to download these files
    5. storing variables using system
      >> On 30 Jun 2003 07:31:04 -0700, ^^^^ What is "this"? The question has a number of answers, depending on what you actually mean. Give a...
  3. #2

    Default Re: Storing session variables into a Database JSP

    sounds like the chapter 22 tutorial of the book "dreamweaver the missing manual" i think thats the name. it's on line. sorry i can't be more help



    bigdog205 webforumsuser@macromedia.com Guest

  4. #3

    Default Re: Storing session variables into a Database JSP

    Use a bean.

    When the user fills out stuff on first page, put that stuff in a bean. Don't allow the second page until the user bean has the requisite data.

    public class User {
    private String _name;
    private int _age;
    private char sex;

    public User(String name, int age, char sex) throws IllegalArgumentException {
    _name = name;
    _age = age; // check this value out
    _sex = sex; // allow only 'm' , 'f', and 't'
    }

    public void setName(String name) {

    _name = name;
    }
    }

    Make a table in the DB. Check the bean out -- programmatically validate to make sure age is a whole number less than 110, fields aren't blank, et c.

    Make a java class with a static method to connect to the DB and put each field into the DB.

    DBQ.createOrModifyUser(User user);


    [url]http://dhtmlkitchen.com/[/url]
    dhtmlkitchen webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139