This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Creates an index if it does not already exist in MySQL. | |
-- Code by RolandoMySQLDBA, minor modifications by Adam Matan. | |
-- License: CC BY-SA, http://creativecommons.org/licenses/by-sa/3.0/ | |
-- Source: http://dba.stackexchange.com/questions/24531/mysql-create-index-if-not-exists/24541#24541 | |
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS `pixels`.`CreateIndex` $$ | |
CREATE PROCEDURE `pixels`.`CreateIndex` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS drop_index_if_exists $$ | |
CREATE PROCEDURE drop_index_if_exists(in theTable varchar(128), in theIndexName varchar(128) ) | |
BEGIN | |
IF((SELECT COUNT(*) AS index_exists FROM information_schema.statistics WHERE TABLE_SCHEMA = DATABASE() and table_name = | |
theTable AND index_name = theIndexName) > 0) THEN | |
SET @s = CONCAT('DROP INDEX `' , theIndexName , '` ON `' , theTable, '`'); | |
PREPARE stmt FROM @s; | |
EXECUTE stmt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Font; | |
import java.awt.Graphics; | |
import java.awt.image.BufferedImage; | |
import java.util.Random; | |
import javax.imageio.ImageIO; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import javax.servlet.http.HttpSession; |