Drop table from database : Table « Database « Java Tutorial






import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Main {
  public static void main(String[] args) throws Exception {
    Class.forName("oracle.jdbc.driver.OracleDriver");

    String url = "jdbc:oracle:thin:@localhost:1521:demo";

    String username = "java";
    String password = "";

    String sql = "DROP TABLE books";

    Connection connection = DriverManager.getConnection(url, username, password);
    Statement statement = connection.createStatement();
    statement.execute(sql);
    connection.close();
  }
}








20.26.Table
20.26.1.Create a table in database
20.26.2.Delete record from table
20.26.3.Description of Database Table
20.26.4.Adding a New Column Name in Database Table
20.26.5.Change Column Name of a Table
20.26.6.Make Unique Column in Database Table
20.26.7.Remove Unique Column in Database Table
20.26.8.Arrange a Column of Database Table
20.26.9.Sum of Column in a Database Table
20.26.10.Delete a Column from a Database Table
20.26.11.Copy data from one table to another in a database
20.26.12.Drop table from database
20.26.13.Copy One Database Table to Another