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
CREATE PROCEDURE `GetByCity`(IN cityName varchar(255)) | |
BEGIN | |
select * from user where city=cityName; | |
END | |
//call test_db.GetByCity('Pune'); |
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
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetUser`() | |
BEGIN | |
SELECT * FROM USER ORDER BY FIRST_NAME; | |
END | |
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
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetUser`() | |
BEGIN | |
SELECT * FROM USER ORDER BY FIRST_NAME; | |
END | |
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
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetTotalUser`() | |
BEGIN | |
DECLARE totalUser INT DEFAULT 0; | |
SELECT COUNT(*) INTO totalUser FROM USER; | |
SELECT totalUser; | |
END |
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
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetUser`() | |
BEGIN | |
SELECT * FROM USER ORDER BY FIRST_NAME; | |
END |
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
@Component | |
public class RequestManager{ | |
@Autowired | |
private RequestHandler requestHandler; | |
public void handleRequest(){ | |
requestHandler.handleRequest(); | |
} | |
} |
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
import org.springframework.beans.factory.annotation.Lookup; | |
import org.springframework.stereotype.Component; | |
@Component | |
public class RequestManager{ | |
private RequestHandler requestHandler; | |
public void handleRequest(){ |
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 User { | |
private int id; | |
private String name; | |
//setters & getters | |
@Override | |
public int hashcode() { | |
final int prime = 31; | |
int result = 1; |
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
/* Immutable Class */ | |
public final class Box { | |
private final String key; | |
private final String value; | |
private final HashMap<String, String> hm; | |
public Box(String key, String value, HashMap<String, String> hm) { | |
this.key = key; |
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
/* Singleton class double checking */ | |
public class Technology { | |
private static final Technology instance; | |
private Technology() {} | |
public static synchronized Technology getInstatnce() { | |
if (instance == null) { | |
synchronized (Technology.class) { |