Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.forge.project.jdbc.dao;
- import com.forge.project.jdbc.ConnectionManager;
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- public class EjerciciosDAO {
- private Connection connection;
- public EjerciciosDAO() throws SQLException{
- this.connection = ConnectionManager.obtenerConexion();
- }
- public void editarDeporteEjercicio(String nombre, String apellido, String deporte) throws SQLException {
- String sql = "update ejercicios \n" +
- "set deporte = ?\n" +
- "where nombre = ? and apellido = ?";
- PreparedStatement ps = connection.prepareStatement(sql);
- ps.setString(1, nombre);
- ps.setString(2, apellido);
- ps.setString(3, deporte);
- ps.execute();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement