Deleting a Database Table - Java JDBC

Java examples for JDBC:Table

Description

Deleting a Database Table

Demo Code

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Main {
  public static void main(String[] args) {
    try {/*  w  w w. j ava2 s .c  o m*/
      Connection connection = null;
      Statement stmt = connection.createStatement();
      stmt.executeUpdate("DROP TABLE my_table");
    } catch (SQLException e) {
    }
  }
}

Related Tutorials