This file contains 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
public class ReadTimeoutOption extends Resty.Option { | |
private final int _readTimeout; | |
public ReadTimeoutOption(int milliseconds) { | |
_readTimeout = milliseconds; | |
} | |
public void apply(URLConnection aConnection) { | |
aConnection.setReadTimeout(_readTimeout); | |
} |
This file contains 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
drop procedure if exists category_hier; | |
delimiter # | |
create procedure category_hier | |
( | |
in p_cat_id smallint unsigned, | |
in p_name_separator varchar(3) -- string to separate full name path segments | |
) | |
begin |
This file contains 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
SELECT count(*) | |
INTO @exist | |
FROM information_schema.columns | |
WHERE table_schema = 'databaseName' | |
and COLUMN_NAME = 'columnName' | |
AND table_name = 'tableName'; | |
set @query = IF(@exist <= 0, | |
'alter table whatever', | |
'select \'Column already exists\' status'); |
This file contains 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 trySomething// | |
create procedure trySomething(in _param1 int, in _param2 int) | |
begin | |
-- Condition could be a count, a boolean, whatever. In this case assuming might be running a "select count(*)" | |
-- to determine if a certain row has already been inserted. | |
declare _condition int default null; | |
set _condition = (<SOME_SELECT_THAT_SIGNIFIES_IF_YOUVE_ALREADY_RUN_THIS_SCRIPT>); |