{"id":20235819,"url":"https://github.com/thiswallz/spring-boot-jdbc-mvc","last_synced_at":"2026-04-10T22:47:17.656Z","repository":{"id":144882112,"uuid":"143599903","full_name":"thiswallz/spring-boot-jdbc-mvc","owner":"thiswallz","description":"8 type of request, auto init db and insertions, spring boot project","archived":false,"fork":false,"pushed_at":"2018-08-05T09:35:01.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T10:40:25.790Z","etag":null,"topics":["java","spring","springboot"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiswallz.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-05T09:31:46.000Z","updated_at":"2018-08-05T09:36:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5d255fb-cadf-4d7a-bdd8-ff389f4cf6ad","html_url":"https://github.com/thiswallz/spring-boot-jdbc-mvc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswallz%2Fspring-boot-jdbc-mvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswallz%2Fspring-boot-jdbc-mvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswallz%2Fspring-boot-jdbc-mvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswallz%2Fspring-boot-jdbc-mvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiswallz","download_url":"https://codeload.github.com/thiswallz/spring-boot-jdbc-mvc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241678837,"owners_count":20001831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","spring","springboot"],"created_at":"2024-11-14T08:17:55.325Z","updated_at":"2026-04-10T22:47:12.612Z","avatar_url":"https://github.com/thiswallz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Spring Boot Using diferent kind of request and JDBC \n\n#### Simple run these commands or import this project using your favorite IDE\n\n```sh\nsh mvnw clean install\nsh mvnw spring-boot:run\n```\nUrl: http://localhost:8099/api/todos\n\n\n- http://localhost:8099/api/send1\n\n```java\n    /*\n    {\n\t \"_id\":  5,\n\t \"requestTime\": 1185937200000\n\t}\n     */\n    @RequestMapping(value = \"/send1\", method = RequestMethod.PUT, \n    \t\tconsumes = { MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE })\n    public void send1(@RequestBody Detail detalle) {\n        logger.info(\"detalle send1 getId: \"+detalle.getId());\n        logger.info(\"detalle send1 getRequestTime: \"+detalle.getRequestTime());\n    }\n```\n\n- http://localhost:8099/api/send2\n\n```java\n    /*\n    [{\n\t \"_id\":  5,\n\t \"requestTime\": 1185937200000\n\t},{\n\t \"_id\":  8,\n\t \"requestTime\": 1285937200000\n\t}]\n     */\n    @RequestMapping(value = \"/send2\", method = RequestMethod.POST, \n    \t\tconsumes = { MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE })\n    public void send2(@RequestBody List\u003cDetail\u003e detalles) {\n        logger.info(\"detalle send2 getIdc(0): \"+detalles.get(0).getId());\n        logger.info(\"detalle send2 getIdc(1): \"+detalles.get(1).getId());\n    }\n```\n\n- http://localhost:8099/api/send3\n\n```java\n    /*\n     {\n\t   \"other\":  \"Dyn text 1\",\n\t   \"other2\": \"Other property\"\n\t  }\n     */\n    @RequestMapping(value = \"/send3\", method = RequestMethod.POST, \n    \t\tconsumes = { MediaType.APPLICATION_JSON_VALUE })\n    public void send3(@RequestBody String body) throws JSONException {\n    \tMap\u003cString, String\u003e properties = new HashMap\u003c\u003e();\n    \ttry {\n    \t    ObjectMapper mapper = new ObjectMapper();\n    \t    properties = mapper.readValue(body, new TypeReference\u003cMap\u003cString, String\u003e\u003e() {\n    \t    });\n    \t \n    \t} catch (IOException e) {   \n    \t    e.printStackTrace();\n    \t}\n        logger.info(\"detalle send3 other: \"+properties.get(\"other\"));\n        logger.info(\"detalle send3 other2: \"+properties.get(\"other2\"));\n    }\n```\n\n- http://localhost:8099/api/send4\n\n```java\n    /*\n       [\n\t\t{\n\t\t \"other\":  \"Dyn text 1\",\n\t\t \"other2\": \"Dyn prop 1\"\n\t\t},\n\t\t{\n\t\t \"other\":  \"Dyn text 2\",\n\t\t \"other2\": \"Dyn prop 2\"\n\t\t}\n\t   ]\n     */\n    @RequestMapping(value = \"/send4\", method = RequestMethod.POST, \n    \t\tconsumes = { MediaType.APPLICATION_JSON_VALUE })\n    public void send4(@RequestBody String body) throws JSONException {\n    \tList\u003cMap\u003cString, String\u003e\u003e properties = new ArrayList\u003cMap\u003cString, String\u003e\u003e();\n    \ttry {\n    \t    ObjectMapper mapper = new ObjectMapper();\n    \t\tJavaType collectionType = mapper.getTypeFactory().constructCollectionType(List.class, Map.class);\n    \t    properties = mapper.readValue(body, collectionType);\n    \t \n    \t} catch (IOException e) {   \n    \t    e.printStackTrace();\n    \t}\n        logger.info(\"send4 other: \"+properties.get(0).get(\"other\"));\n        logger.info(\"send4 other2: \"+properties.get(1).get(\"other\"));\n    }\n```\n\n- http://localhost:8099/api/send5\n\n```java\n    /*\n\t{\n\t \"other\":  \"Dyn text 1\",\n\t \"other2\": \"Other prop\",\n\t \"mydetail\": {\n\t\t \"_id\":  11,\n\t\t \"requestTime\": 1185937200000\n\t\t}\n\t}\n     */\n    @RequestMapping(value = \"/send5\", method = RequestMethod.POST, \n    \t\tconsumes = { MediaType.APPLICATION_JSON_VALUE })\n    public void send5(@RequestBody String body) throws JSONException {\n    \tMap\u003cString, Object\u003e properties = new HashMap\u003c\u003e();\n    \ttry {\n    \t    ObjectMapper mapper = new ObjectMapper();\n    \t    properties = mapper.readValue(body, new TypeReference\u003cMap\u003cString, Object\u003e\u003e() {\n    \t    });\n    \t    \n    \t    logger.info(\"properties.get(\\\"mydetail\\\"): \" + properties.get(\"mydetail\"));\n    \t    \n    \t    Map\u003cString, Object\u003e detalle = (Map\u003cString, Object\u003e) properties.get(\"mydetail\");\n    \t       \t    \n\t        logger.info(\"send5 getId: \" + detalle.get(\"_id\"));\n\t        logger.info(\"send5 getRequestTime: \" + detalle.get(\"requestTime\"));\n    \t \n    \t} catch (IOException e) {   \n    \t    e.printStackTrace();\n    \t}\n \n    }\n```\n\n\n- http://localhost:8099/api/send6\n\n```java\n    @RequestMapping(value = \"/send6\", method = RequestMethod.POST)\n    public void send6(@RequestParam(\"name\") String name, @RequestParam(\"lastName\") String lastName) {\n        logger.info(\"send6 name: \"+name);\n        logger.info(\"send6 lastName: \"+lastName);\n    }\n```\n\n\n- http://localhost:8099/api/send7\n\n```java\n    @RequestMapping(value = \"/send7/{id}\", method = RequestMethod.PUT)\n    public void send7(@PathVariable(\"id\") Integer detailId,\n    \t\t@RequestParam(\"name\") String name, \n    \t\t@RequestParam(\"lastName\") String lastName) {\n    \t\n    \tlogger.info(\"send7 id: \"+detailId);\n        logger.info(\"send7 name: \"+name);\n        logger.info(\"send7 lastName: \"+lastName);\n    }\n```\n\n\n\n- http://localhost:8099/api/send8\n\n```java\n    @RequestMapping(value = \"/send8\", method = RequestMethod.GET)\n    public void send8(@RequestParam(\"name\") String name, \n    \t\t@RequestParam(\"lastName\") String lastName) {\n    \t\n        logger.info(\"send8 name: \"+name);\n        logger.info(\"send8 lastName: \"+lastName);\n    }\n```\n\n\n```\n- Config for auto init DB\n```\nspring.datasource.initialize=true\nspring.datasource.schema=classpath:/schema.sql\nspring.datasource.data=classpath:/data.sql\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiswallz%2Fspring-boot-jdbc-mvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiswallz%2Fspring-boot-jdbc-mvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiswallz%2Fspring-boot-jdbc-mvc/lists"}