conn=ds.getConnection();
PreparedStatement ps=conn.prepareStatement("INSERTINTO"
+"customers(id,first_name,last_name,email,phone_number) "
+"VALUES(?,?,?,?,?)");
ps.setInt(1,id);
ps.setString(2,first_name);
ps.setString(3,last_name);
ps.setString(4,email);
ps.setString(5,phone);
ps.executeUpdate();
ps.close();
conn.close();
}
//MethodtoaddtheFlightdataintotheFlightstable
publicstaticvoidaddFlight(intid,intdeparture_ap_id,int arrival_ap_id,String
departure_time,String arrival_time,float price,Stringdomestic)throwsSQLException{
conn=ds.getConnection();
PreparedStatement ps=conn.prepareStatement("INSERTINTO"
+
"flights(id,departure_airport_id,arrival_airport_id,departure_time,arrival_time,price,
domestic)"
+"VALUES(?,?,?,?,?,?,?)" );
ps.setInt(1,id);
ps.setInt(2,departure_ap_id);