Skip to content

Instantly share code, notes, and snippets.

View prashant4224's full-sized avatar
🏠
Working From Home

Prashant Jeerankalagi prashant4224

🏠
Working From Home
View GitHub Profile
CREATE PROCEDURE `GetByCity`(IN cityName varchar(255))
BEGIN
select * from user where city=cityName;
END
//call test_db.GetByCity('Pune');
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetUser`()
BEGIN
SELECT * FROM USER ORDER BY FIRST_NAME;
END
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetUser`()
BEGIN
SELECT * FROM USER ORDER BY FIRST_NAME;
END
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetTotalUser`()
BEGIN
DECLARE totalUser INT DEFAULT 0;
SELECT COUNT(*) INTO totalUser FROM USER;
SELECT totalUser;
END
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetUser`()
BEGIN
SELECT * FROM USER ORDER BY FIRST_NAME;
END
@Component
public class RequestManager{
@Autowired
private RequestHandler requestHandler;
public void handleRequest(){
requestHandler.handleRequest();
}
}
import org.springframework.beans.factory.annotation.Lookup;
import org.springframework.stereotype.Component;
@Component
public class RequestManager{
private RequestHandler requestHandler;
public void handleRequest(){
public class User {
private int id;
private String name;
//setters & getters
@Override
public int hashcode() {
final int prime = 31;
int result = 1;
/* 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;
/* 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) {