Berikut Kodingnya :
void inputdata()
{
initconnection();
try {
Statement st = (Statement) stng.getConnection().createStatement();
int mAffect = st.executeUpdate("INSERT INTO `db_me`.`tb_me_1` (`ID`,`NAME`) VALUES ('"+id_me.getText()+"', '"+my_name.getText()+"');");
if (mAffect>0) {
System.out.println("Success");
}
st.close();
JOptionPane.showMessageDialog(this,"Success for Input !!!");
}
catch (SQLException ex)
{
System.out.println(ex);
}
}
Post a Comment