delete item from mysql database
hey guys..
i have used this code to show data from mysql database through JComboBox
Code :
DefaultComboBoxModel model=(DefaultComboBoxModel) jComboBox6.getModel();
String sql="SELECT * FROM department";
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/store","root","root");
Statement stat= con.createStatement();
ResultSet res= stat.executeQuery(sql);
while(res.next())
{
String name=res.getString("dep_name");
model.addElement(name);
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage());
}
now i want the code to delete selected item from JCombBox from database plz
Re: delete item from mysql database
And what problems are you facing?
Re: delete item from mysql database
Quote:
Originally Posted by
Mr.777
And what problems are you facing?
there is no problem sir,
but what i want is the java code to delete selected item from mysql database
Re: delete item from mysql database
Well, the problem is if you've read the forums rules, you would never ask for the code. In fact, you would come to know that everyone will ask you, what have you tried so far? Where exactly you are facing the problems. Now let's come to your question, if you will google it, you will find hundreds of result pages.