Ejemplo n.º 1
0
 public void updateUncompletedPlayer(Player player) throws SQLException {
   PreparedStatement pstm =
       connection.prepareStatement(
           "UPDATE player SET height = ?, youth_team_id = ?, exists_in_sokker = ? WHERE id_player = ?");
   pstm.setInt(1, player.getHeight());
   pstm.setInt(2, player.getYouthTeamId());
   pstm.setInt(3, Player.EXISTS_IN_SOKKER_TRUE);
   pstm.setInt(4, player.getId());
   pstm.executeUpdate();
   pstm.close();
 }
Ejemplo n.º 2
0
 public void addPlayer(Player player) throws SQLException {
   PreparedStatement pstm =
       connection.prepareStatement(
           "INSERT INTO player(id_player,name,surname,countryfrom, id_club_fk, status, national, transfer_list, youth_team_id, height) VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, ?)");
   pstm.setInt(1, player.getId());
   pstm.setString(2, player.getName());
   pstm.setString(3, player.getSurname());
   pstm.setInt(4, player.getCountryfrom());
   pstm.setInt(5, player.getTeamId());
   pstm.setInt(6, player.getNational());
   pstm.setInt(7, player.getTransferList());
   pstm.setInt(8, player.getYouthTeamId());
   pstm.setInt(9, player.getHeight());
   pstm.executeUpdate();
   pstm.close();
 }