Fred thank you very much ....your reply made me think once again over my block of code and i got my mistake.
the error was in line 6 as pointed by you.
Now i am able to insert the data into the database.
i would like to share the code that will help to insert multiple rows into the database using textboxes with same names i.e txtpsngrnm,psngrsex,psngrage are the names of the textboxes.
stmt.executeQuery("insert into fbook(fbid,fpname,fpage,fpgender) values('"+j+"','"+pname[j] +"','"+psage[j]+"','"+pgender[j]+"')");
Thank You All for your help