Hello pals,
this is a code snippet in which I insert two strings into MSACESS .while
Im able to insert the
string myname,Im not able to insert pc.Is there any problem with making more than one prepared statement on a connection object or is it some silly sql syntax error?
public void storePhone(String x,String y){
myname=x;pc=y;
try{
System.out.println("in storephone pc="+pc);
String sqlname="INSERT INTO PHONEDIARY(NAME)VALUES(?)";
ps=con.prepareStatement(sqlname);
ps.setString(1,myname);
ps.executeUpdate();
String sqlphone="INSERT INTO PHONEDIARY(PHONENUMBER)VALUES(?)";
ps2=con.prepareStatement(sqlphone);
ps2.setString(2,pc);
ps2.executeUpdate();
}
catch(Exception e){}
}
Thanks in advance for the help!
regs-Rajesh