public void cosUpdate(String sr,String name,String fname,String adress,String phone,String refernce,String tailor)
{
try{
String QUERY1 = "UPDATE Info1 SET FatherName = '"+fname+"' WHERE Sr = '"+sr+"'";
JOptionPane.showMessageDialog(null,QUERY1);
Class.forName(JDBC_DRIVER);
connection=DriverManager.getConnection(DATABASE_URL);
statement=connection.createStatement();
result =statement.executeUpdate(QUERY1);
if(result >0)
JOptionPane.showMessageDialog(null,"Successfull");
else
JOptionPane.showMessageDialog(null,"UnSuccessfull");
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,"Error in cosUpdate() Method","Error",JOptionPane.ERROR_MESSAGE);
}
finally{
try{
resultset.close();
statement.close();
connection.close();
}
catch(Exception ex){
}
}
RazaAjmi 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.