Java SQL Table Drop dropTablesIfExist(Statement statement)

Here you can find the source of dropTablesIfExist(Statement statement)

Description

drop Tables If Exist

License

Open Source License

Declaration

private static void dropTablesIfExist(Statement statement) throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.*;

public class Main {
    private static void dropTablesIfExist(Statement statement) throws SQLException {
        String dropSql = "DROP TABLE IF EXISTS transaction;";
        String dropSql1 = "DROP TABLE IF EXISTS part;";
        String dropSql2 = "DROP TABLE IF EXISTS category;";
        String dropSql3 = "DROP TABLE IF EXISTS salesperson;";
        String dropSql4 = "DROP TABLE IF EXISTS manufacturer;";
        statement.execute(dropSql);// w  ww . ja v  a  2  s  .  c om
        statement.execute(dropSql1);
        statement.execute(dropSql2);
        statement.execute(dropSql3);
        statement.execute(dropSql4);
    }
}

Related

  1. dropTable(Connection connection, String tableName)
  2. dropTable(Connection dbConn, String tableName)
  3. dropTable(java.sql.Connection conn, java.lang.String table)
  4. dropTable(Statement st, String query)
  5. dropTableIfExists(String tableName, java.sql.Statement stmt)