Java SQL Table Drop deleteTable(Connection con, String tableName)

Here you can find the source of deleteTable(Connection con, String tableName)

Description

delete Table

License

Apache License

Declaration

public static void deleteTable(Connection con, String tableName) throws SQLException 

Method Source Code


//package com.java2s;
/*//from  w ww  .j  a va2s.  c o  m
 * codjo.net
 *
 * Common Apache License 2.0
 */

import java.sql.Connection;

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

public class Main {
    public static void deleteTable(Connection con, String tableName) throws SQLException {
        Statement stmt = null;
        try {
            stmt = con.createStatement();
            stmt.executeUpdate("delete " + tableName);
        } finally {
            if (stmt != null) {
                stmt.close();
            }
        }
    }
}

Related

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