*
The moose likes Cattle Drive and the fly likes Secret to inserting records from html form????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Secret to inserting records from html form?????" Watch "Secret to inserting records from html form?????" New topic
Author

Secret to inserting records from html form?????

Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1194
Is there a secret command to use when inserting a record into a database from a html form? I have been working on JDBC2 from the cattle drive, and for some reason I can't get all of data from my form into the table in the database. There are 3 types of input fields, and they are working properly because I can print out the user input to teh web page, but for some reason only the input from the text fields and radio buttons are being inserted into the database.
My table is set up with 6 columns. The 4 that work are varchar() of different lengths. The 2 that don't work are char(1). I tried changing them to varchar(). Didn't work.
I'm using statement.update( "INSERT INTO MYTABLE VALUES ( '"+variable1+"' , '"+variable2+"' , etc))"
The syntax is the same for all 6 columns, and all 6 columns are being passed an appropriate value, but mysql can't seem to insert the whole row into the table.
HELP!!!
I'm starting to obsess over this!
Blake Minghelli
Ranch Hand

Joined: Sep 13, 2002
Posts: 331
Can you show more of your code? Are you getting a SQLException on the INSERT or are just ending up with null values in some of your db fields?


Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Since this is a Cattle Drive question, I'm moving it there just in case someone accidentally solves it.
Dave
Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1746
    
    2
See the original thread for my working theory on what's going wrong.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Secret to inserting records from html form?????
 
Similar Threads
How to handle comma in the text field?
Hibernate getting started
mysql & incomplete insertions!
Using a Trigger to Calculate a Value (SQL Server)
I'm stumped!