In the present work, the oscillation of a spark-created bubble near a confined water-air interface and the ensuing droplet generation and ejection are studied numerically using the boundary element method. The interface is accorded by the top opening of either one of the following symmetrical configurations, which are distinguished by the value of angle between their vertical symmetry axis and lateral wall (i.e., theta): (i) a centrally perforated horizontal flat plate (theta = 90A degrees) and (ii) vertically placed cylinder (theta = 0A degrees), nozzle (theta > 0A degrees) and diffuser (theta < 0A degrees). Furthermore, the influences of the effective parameters such as the strength parameter (i.e., the intensity of local energy input), the bubble-free surface distance (standoff distance) and the nozzle size on the bubble dynamics and droplet formation and ejection processes are investigated. It was found that the moment at which the bubble attained its maximum volume was advanced as theta increased. In addition, by decreasing theta the attraction of the bubble toward the free surface during its expansion phase and its migration from the free surface during its contraction phase became stronger. Furthermore, for the nozzle case, by increasing theta, the volume of the droplet was increased. It was also found that by increasing the strength parameter, the volume of the droplet increased and its pinch-off happened earlier. Finally, as the standoff distance was increased, the volume of the droplet increased and its pinch-off was delayed.