Answers for "Which of the following executes an DELETE SQL statement in java"

1

statement delete sql java

public static void DeleteRow(String name) {
    try {  
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection(url, username, password);
        PreparedStatement st = connection.prepareStatement("DELETE FROM Table WHERE name = ?");
        st.setString(1,name);
        st.executeUpdate(); 
    } catch(Exception e) {
        System.out.println(e);
    }
}
Posted by: Guest on February-04-2021

Code answers related to "Which of the following executes an DELETE SQL statement in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language