Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
First of all, you are not inserting the values of the variables into the string that is submitted (which, by the way should have a nicer name than "s1" if I may offer my opinion). You need to build it up by adding in the contents of the data strings, not the variable names. Additionally, you need to put quotes around the string values you are submitting to the database. Look at a SQL book or documentation for mySQL to see syntax for entering different datatypes. So, you might have something like this:
and so on. Note that I didn't quote the customer number, because I assume the field in the database is numeric, not string. If it is string (why?), then it should be quoted to. Also, another note on style: I wouldn't hard-code the table and column names into various string throughout the code, because if they are changed, you have a big maintenance mess. It might be better to make constant (static final) Strings for them. - mfg Replies: |
Sponsored Links
|