{"id":19486489,"url":"https://github.com/phxql/spring-boot-with-jdbi","last_synced_at":"2025-08-24T13:21:37.150Z","repository":{"id":65832148,"uuid":"504496308","full_name":"phxql/spring-boot-with-jdbi","owner":"phxql","description":"An example project which showcases Spring Boot with JDBI.","archived":false,"fork":false,"pushed_at":"2025-08-20T18:39:44.000Z","size":229,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-20T20:45:42.547Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phxql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-06-17T10:43:27.000Z","updated_at":"2025-08-20T18:39:42.000Z","dependencies_parsed_at":"2024-02-13T19:29:05.560Z","dependency_job_id":"016101c4-a539-4264-8ab6-3b6b17b198e9","html_url":"https://github.com/phxql/spring-boot-with-jdbi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phxql/spring-boot-with-jdbi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fspring-boot-with-jdbi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fspring-boot-with-jdbi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fspring-boot-with-jdbi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fspring-boot-with-jdbi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phxql","download_url":"https://codeload.github.com/phxql/spring-boot-with-jdbi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fspring-boot-with-jdbi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271873616,"owners_count":24837277,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest"],"created_at":"2024-11-10T20:37:58.457Z","updated_at":"2025-08-24T13:21:37.086Z","avatar_url":"https://github.com/phxql.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot with JDBI\n\n[![Java CI](https://github.com/phxql/spring-boot-with-jdbi/actions/workflows/build.yaml/badge.svg)](https://github.com/phxql/spring-boot-with-jdbi/actions/workflows/build.yaml)\n\nAn example project which showcases Spring Boot with JDBI.\n\n* Database migrations are in [src/main/resources/db/migration](src/main/resources/db/migration) and are executed through\n  Flyway\n* JDBI Spring configuration is\n  in [JdbiConfiguration](src/main/java/de/mkammerer/jdbispring/database/JdbiConfiguration.java)\n\n## Running\n\n* `./mvnw spring-boot:run` OR\n* start the `main` method of `de.mkammerer.jdbispring.JdbiSpringApplication` in your IDE\n\n## Find all tasks\n\n* `curl http://localhost:8080/task -s -S -v -H \"Accept: application/json, */*\"`\n* This is handled by the [TaskController](src/main/java/de/mkammerer/jdbispring/rest/TaskController.java)\n\n## Create a task\n\n* `curl -X POST -d '{\"due\":\"2023-01-01T00:00:00Z\",\"title\":\"bar\"}' http://localhost:8080/task -s -S -v -H \"Content-Type: application/json\" -H \"Accept: application/json, */*\"`\n* This is handled by the [TaskController](src/main/java/de/mkammerer/jdbispring/rest/TaskController.java)\n\n## JDBI Configuration\n\nThe [JdbiConfiguration](src/main/java/de/mkammerer/jdbispring/database/JdbiConfiguration.java) creates 3 beans:\n\n* The `Jdbi` bean, which is used by the `TaskDao` bean. The `Jdbi` bean uses the `TransactionAwareDataSourceProxy` to\n  be aware of the Spring managed transactions. Additionally, it picks up all registered `JdbiPlugin`s and `RowMapper`s\n  beans and registers them on the JDBI system.\n* The `SqlObjectPlugin` bean. This bean will then be picked up by the `Jdbi` bean to be registered on the JDBI system.\n  The `SqlObjectPlugin` allows the use of the DAO interfaces, see\n  the [`TaskDao`](src/main/java/de/mkammerer/jdbispring/database/TaskDao.java)\n  for an example.\n* The `TaskDao` bean, which is used by\n  the [`JdbiTaskRepository`](src/main/java/de/mkammerer/jdbispring/database/JdbiTaskRepository.java)\n  to do the database access through JDBI.\n* Note: There's an additional bean which is used by JDBI:\n  the [`TaskRowMapper`](src/main/java/de/mkammerer/jdbispring/database/TaskRowMapper.java).\n  This bean is not created via a `@Bean` method but is registered as a bean via the `@Component` annotation. As this\n  bean\n  implements `RowMapper`, it is used by the `Jdbi` bean and is registered in the JDBI system. This bean is used to\n  convert JDBC records to `Task` objects, which is needed by the `TaskDao` bean.\n\n## License\n\n[CC0](https://creativecommons.org/publicdomain/zero/1.0/deed.en)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphxql%2Fspring-boot-with-jdbi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphxql%2Fspring-boot-with-jdbi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphxql%2Fspring-boot-with-jdbi/lists"}