import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import com.mysql.jdbc.MySQLConnection; public class JDBCShutdownTest { public static void main(String[] args) { try { Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", null); conn.unwrap(MySQLConnection.class).shutdownServer(); } catch (SQLException ex) { System.out.println("Shutdown failed: " + ex.getMessage()); ex.printStackTrace(System.out); } } }