GeeCON Prague 2014*
The moose likes JDBC and the fly likes insertion of values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "insertion of values" Watch "insertion of values" New topic
Author

insertion of values

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
I am using following code to insert the values from a servlet to database.....i1,q1,c1,i2,q2,c2,i3,q3,c3 and other values are retrieved from servlet....then are stored in pdf but if i want to enter only one value from the servlet that is only value of i1,q1,c1.then what should i do....
coding of servlet (to enter values ) is as

this code for inserting values from user with the help of servlet


This is another servlet in which i am retreiving values from the first servlet


and ny problem is this ...that if i insert values in first servlet for only i1,q1,c1 then it will give error because these are inserted in the database and exception is thrown (SQLException caught: ORA-00936: missing expression )
i dont want these fields compulsory....what should i do for this
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

rakhi sinha wrote:I am using following code to insert the values from a servlet to database.....i1,q1,c1,i2,q2,c2,i3,q3,c3 and other values are retrieved from servlet....then are stored in pdf but if i want to enter only one value from the servlet that is only value of i1,q1,c1.then what should i do....
coding of servlet (to enter values ) is as



I am sorry I am completely lost you say you only want to insert 1 value from the servlet then list 3 items i1,c1 and q1.
It is very difficult to follow code when the variable and colum names are so short and meaningless. If this is actual production code it is almost completely unmaintainable.
 
GeeCON Prague 2014
 
subject: insertion of values