Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class DeleteExample {
  4. public static void main(String[] args) {
  5. Connection connection = null;
  6. try {
  7. Class.forName("com.mysql.jdbc.Driver");
  8. connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/student", "root", "");
  9. Statement statement = connection.createStatement();
  10. statement.executeUpdate("DELETE FROM student_table where class like '14T2'");
  11. System.out.println("DONE!");
  12. } catch (ClassNotFoundException | SQLException e) {
  13. System.out.println(e);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement