String query = "INSERT INTO product(Name, ModelNo, Price, Qty,description,categoryID) VALUES(?,?,?,?,?,?)";
System.out.println("CategorycomboBox : "+ CategorycomboBox.getSelectedItem());
System.out.println("categoryMap : "+ categoryMap.get(CategorycomboBox.getSelectedItem()));
PreparedStatement ps = (PreparedStatement) con.prepareStatement(query);
ps.setString(1, productnameTextField.getText());
ps.setString(2, modelTextField.getText());
ps.setString(3, priceTextField.getText());
ps.setString(4, quantityTextField.getText());
ps.setString(5, descriptionTextArea_1.getText());
ps.setInt(6, categoryMap.get(CategorycomboBox.getSelectedItem()));
System.out.println(ps);
try{
ps.executeUpdate();
}catch(SQLException e){
JOptionPane.showMessageDialog(null, "Please insert price and quantity properly",null, 0);
}