Hi .. to all......
i hav created the following codes in order to update the data... i don't know wats the problem.... plz help me to resolve my problem........ .
Regards
Pradeep
i hav created the following codes in order to update the data... i don't know wats the problem.... plz help me to resolve my problem........ .
Regards
Pradeep
Code:
if(ae.getSource()==mod)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:prism");
stmt1=con.createStatement();
rs=stmt1.executeQuery("select * from Customerdetails");
while(rs.next())
{
String query = "Update Customerdetails SET CompanyName="+s2+",Address="+s3+",PhoneNumber="+s4+",Contactperson="+s5+",EmailAddress="+s6+",FaxNumber="+s7+" where CustomerID='"+s1+"'";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:prism");
stmt2=con.createStatement();
stmt2.executeUpdate(query);
}
}
catch(ClassNotFoundException e)
{
System.out.println(e);
}
catch(SQLException e)
{
System.out.println(e);
}
}
Comment