Java SQL Table Drop dropTable(Connection conn, String table)

Here you can find the source of dropTable(Connection conn, String table)

Description

drop Table

License

Apache License

Declaration

public static void dropTable(Connection conn, String table) 

Method Source Code

//package com.java2s;
//  Licensed under the Apache License, Version 2.0 (the "License");

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

import java.sql.Connection;

import java.util.logging.*;

public class Main {
    public static void dropTable(Connection conn, String table) {
        Statement stmt = null;//  w  ww .j  av  a2 s  .  c o m

        try {
            stmt = conn.createStatement();
            stmt.executeUpdate("drop table " + table);
        } catch (SQLException e) {
            Logger.global.log(Level.FINE, "Drop table failed for = " + table);
            Logger.global.log(Level.FINE, "==============\n\n");
        } finally {
            try {
                stmt.close();
            } catch (Exception ex) {
            }
        }
    }
}

Related

  1. delete(Connection conn, String table, Serializable id)
  2. deleteMySqlTable(String tableName, Statement stmt)
  3. deleteTable(Connection con, String tableName)
  4. dropTable(Connection con, String table)
  5. dropTable(Connection con, String tableName)
  6. dropTable(Connection conn, String tablename)
  7. dropTable(Connection conn, String tableName)
  8. dropTable(Connection connection)
  9. dropTable(Connection connection)