String query="insert into Boat(houseboat_id,houseboat_name,houseboat_capacity,booking_date,customer_name,customer_id)values(?,?,?,?,?,?)"; PreparedStatement pst=c.prepareStatement(query); pst.setInt(1, Integer.parseInt(tf1.getText())); pst.setString(2, tf2.getText()); pst.setInt(3, Integer.parseInt(tf3.getText())); // cannot setdate here pst.setString(5,tf5.getText()); pst.setInt(6, Integer.parseInt(tf6.getText())); pst.executeQuery(); JOptionPane.showMessageDialog(null,"Data saved"); } catch(Exception ex ) { ex.printStackTrace(); } } });
booking_date
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)