Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class DeleteExample {
- public static void main(String[] args) {
- Connection connection = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/student", "root", "");
- Statement statement = connection.createStatement();
- statement.executeUpdate("DELETE FROM student_table where class like '14T2'");
- System.out.println("DONE!");
- } catch (ClassNotFoundException | SQLException e) {
- System.out.println(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement