hi, i am having a problem in inserting the data into database,i have 2 insert 4 rows into a column n every thing the last row overwrites the rest n only the last row is displayed in the database the code is blow,plz help me slove this problem... the opt1,opt2,opt3 are over written by opt4 n only opt4 is there is the database thanks in advance...
There is nothing abnormal happening here I believe. You are making only one insert and hence one row is getting inserted. Only opt4 is getting inserted only because of this line : pstat1.setString(2,opt4); Replace opt4 with opt3, then only a row with opt3 will appear. Make 4 inserts (instead of one) in order to insert 4 rows. You may also go for a batch insert. [ March 16, 2004: Message edited by: Varun Khanna ]
subject: problem with inserting data in a same column using prepared statement