[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"searchBlogPosts":3,"content-\u002Fblog\u002F2023\u002F09\u002F17\u002Fspring-boot-postgresql":7},[4],{"_path":5,"title":6},"\u002Fblog\u002F2023\u002F09\u002F17\u002Fspring-boot-postgresql","Spring Boot with PostgreSQL & pgAdmin in Docker",{"_path":5,"_dir":8,"_draft":9,"_partial":9,"_locale":10,"title":6,"description":11,"slug":12,"date":13,"published":14,"author":15,"tags":16,"cover":18,"video":19,"github":19,"keywords":20,"body":21,"_type":527,"_id":528,"_source":529,"_file":530,"_stem":531,"_extension":532,"sitemap":533},"17",false,"","Embarking on your journey with Spring IO is a breeze, and I'm here to guide you through the initial steps. The process begins at start.spring.io, where you'll set up a Maven project with Java, opting for the latest Spring Boot version (currently 3.1.1). To personalize your project, choose \"dev.vishsali\" as the group ID . Our Java arsenal will be fortified with version 17, and included the following dependencies: the web dependency, Spring Data JPA, Postgres driver, and Spring Boot's Docker Compose support.","spring-boot-postgresql","2023-09-17T17:00:00.000Z",true,"Vishwaraj Sali",[17],"Spring Boot",".\u002Fspring-boot-postgresql.png",null,"Spring Framework, Spring Boot, PostgreSQL, pgAdmin",{"type":22,"children":23,"toc":525},"root",[24,33,50,55,60,69,75,347,353,366,372,445,452,459,465,472,477,507,514,519],{"type":25,"tag":26,"props":27,"children":29},"element","h1",{"id":28},"_1-getting-started-with-spring-io",[30],{"type":31,"value":32},"text","1. Getting started with Spring IO",{"type":25,"tag":34,"props":35,"children":36},"p",{},[37,39,48],{"type":31,"value":38},"Embarking on your journey with Spring IO is a breeze, and I'm here to guide you through the initial steps. The process begins at ",{"type":25,"tag":40,"props":41,"children":45},"a",{"href":42,"rel":43},"http:\u002F\u002Fstart.spring.io\u002F",[44],"nofollow",[46],{"type":31,"value":47},"start.spring.io",{"type":31,"value":49},", where you'll set up a Maven project with Java, opting for the latest Spring Boot version (currently 3.1.1). To personalize your project, choose \"dev.vishsali\" as the group ID . Our Java arsenal will be fortified with version 17, and included the following dependencies: the web dependency, Spring Data JPA, Postgres driver, and Spring Boot's Docker Compose support.",{"type":25,"tag":34,"props":51,"children":52},{},[53],{"type":31,"value":54},"Now, let's dive into the generated project. Notice that a pre-configured compose.yml file awaits you, sparing you the effort of manual creation. This file is auto-generated due to our inclusion of the Docker Compose module and the definition of a service to be seamlessly integrated.",{"type":25,"tag":34,"props":56,"children":57},{},[58],{"type":31,"value":59},"With the groundwork laid, proceed to generate the project. A conveniently packaged zip file will be at your disposal, ready to be unfolded in your preferred IDE or text editor. In this demonstration, I'll be navigating through the setup using the IntelliJ Ultimate Edition. So, buckle up and let's embark on this Spring IO adventure together!",{"type":25,"tag":34,"props":61,"children":62},{},[63],{"type":25,"tag":64,"props":65,"children":68},"img",{"alt":66,"src":67},"Untitled","https:\u002F\u002Fprod-files-secure.s3.us-west-2.amazonaws.com\u002F2dc11d34-bac0-4492-87c3-597b450b63f7\u002Ff88f76ef-2748-4aa1-8264-31127f157408\u002FUntitled.png",[],{"type":25,"tag":26,"props":70,"children":72},{"id":71},"_2-writing-a-simple-application-with-events-and-sessions",[73],{"type":31,"value":74},"2. Writing a simple application with Events and sessions",{"type":25,"tag":76,"props":77,"children":81},"pre",{"className":78,"code":79,"language":80,"meta":10,"style":10},"language-java shiki shiki-themes nord github-dark monokai","@Entity\n@NoArgsConstructor\n@AllArgsConstructor\npublic class Event {\n    @Id\n    @GeneratedValue\n    private Integer id;\n    private String name;\n    private String description;\n    private LocalDate startDate;\n    private LocalDate endDate;\n    private String locations;\n    private String websites;\n}\n","java",[82],{"type":25,"tag":83,"props":84,"children":85},"code",{"__ignoreMap":10},[86,104,117,130,156,170,183,210,232,253,275,296,317,338],{"type":25,"tag":87,"props":88,"children":91},"span",{"class":89,"line":90},"line",1,[92,98],{"type":25,"tag":87,"props":93,"children":95},{"style":94},"--shiki-default:#ECEFF4;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2",[96],{"type":31,"value":97},"@",{"type":25,"tag":87,"props":99,"children":101},{"style":100},"--shiki-default:#D08770;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[102],{"type":31,"value":103},"Entity\n",{"type":25,"tag":87,"props":105,"children":107},{"class":89,"line":106},2,[108,112],{"type":25,"tag":87,"props":109,"children":110},{"style":94},[111],{"type":31,"value":97},{"type":25,"tag":87,"props":113,"children":114},{"style":100},[115],{"type":31,"value":116},"NoArgsConstructor\n",{"type":25,"tag":87,"props":118,"children":120},{"class":89,"line":119},3,[121,125],{"type":25,"tag":87,"props":122,"children":123},{"style":94},[124],{"type":31,"value":97},{"type":25,"tag":87,"props":126,"children":127},{"style":100},[128],{"type":31,"value":129},"AllArgsConstructor\n",{"type":25,"tag":87,"props":131,"children":133},{"class":89,"line":132},4,[134,140,145,151],{"type":25,"tag":87,"props":135,"children":137},{"style":136},"--shiki-default:#81A1C1;--shiki-dark:#F97583;--shiki-sepia:#F92672",[138],{"type":31,"value":139},"public",{"type":25,"tag":87,"props":141,"children":142},{"style":136},[143],{"type":31,"value":144}," class",{"type":25,"tag":87,"props":146,"children":148},{"style":147},"--shiki-default:#8FBCBB;--shiki-default-text-decoration:inherit;--shiki-dark:#B392F0;--shiki-dark-text-decoration:inherit;--shiki-sepia:#A6E22E;--shiki-sepia-text-decoration:underline",[149],{"type":31,"value":150}," Event",{"type":25,"tag":87,"props":152,"children":153},{"style":94},[154],{"type":31,"value":155}," {\n",{"type":25,"tag":87,"props":157,"children":159},{"class":89,"line":158},5,[160,165],{"type":25,"tag":87,"props":161,"children":162},{"style":94},[163],{"type":31,"value":164},"    @",{"type":25,"tag":87,"props":166,"children":167},{"style":100},[168],{"type":31,"value":169},"Id\n",{"type":25,"tag":87,"props":171,"children":173},{"class":89,"line":172},6,[174,178],{"type":25,"tag":87,"props":175,"children":176},{"style":94},[177],{"type":31,"value":164},{"type":25,"tag":87,"props":179,"children":180},{"style":100},[181],{"type":31,"value":182},"GeneratedValue\n",{"type":25,"tag":87,"props":184,"children":186},{"class":89,"line":185},7,[187,192,198,204],{"type":25,"tag":87,"props":188,"children":189},{"style":136},[190],{"type":31,"value":191},"    private",{"type":25,"tag":87,"props":193,"children":195},{"style":194},"--shiki-default:#8FBCBB;--shiki-default-font-style:inherit;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[196],{"type":31,"value":197}," Integer",{"type":25,"tag":87,"props":199,"children":201},{"style":200},"--shiki-default:#D8DEE9;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2",[202],{"type":31,"value":203}," id",{"type":25,"tag":87,"props":205,"children":207},{"style":206},"--shiki-default:#81A1C1;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2",[208],{"type":31,"value":209},";\n",{"type":25,"tag":87,"props":211,"children":213},{"class":89,"line":212},8,[214,218,223,228],{"type":25,"tag":87,"props":215,"children":216},{"style":136},[217],{"type":31,"value":191},{"type":25,"tag":87,"props":219,"children":220},{"style":194},[221],{"type":31,"value":222}," String",{"type":25,"tag":87,"props":224,"children":225},{"style":200},[226],{"type":31,"value":227}," name",{"type":25,"tag":87,"props":229,"children":230},{"style":206},[231],{"type":31,"value":209},{"type":25,"tag":87,"props":233,"children":235},{"class":89,"line":234},9,[236,240,244,249],{"type":25,"tag":87,"props":237,"children":238},{"style":136},[239],{"type":31,"value":191},{"type":25,"tag":87,"props":241,"children":242},{"style":194},[243],{"type":31,"value":222},{"type":25,"tag":87,"props":245,"children":246},{"style":200},[247],{"type":31,"value":248}," description",{"type":25,"tag":87,"props":250,"children":251},{"style":206},[252],{"type":31,"value":209},{"type":25,"tag":87,"props":254,"children":256},{"class":89,"line":255},10,[257,261,266,271],{"type":25,"tag":87,"props":258,"children":259},{"style":136},[260],{"type":31,"value":191},{"type":25,"tag":87,"props":262,"children":263},{"style":194},[264],{"type":31,"value":265}," LocalDate",{"type":25,"tag":87,"props":267,"children":268},{"style":200},[269],{"type":31,"value":270}," startDate",{"type":25,"tag":87,"props":272,"children":273},{"style":206},[274],{"type":31,"value":209},{"type":25,"tag":87,"props":276,"children":278},{"class":89,"line":277},11,[279,283,287,292],{"type":25,"tag":87,"props":280,"children":281},{"style":136},[282],{"type":31,"value":191},{"type":25,"tag":87,"props":284,"children":285},{"style":194},[286],{"type":31,"value":265},{"type":25,"tag":87,"props":288,"children":289},{"style":200},[290],{"type":31,"value":291}," endDate",{"type":25,"tag":87,"props":293,"children":294},{"style":206},[295],{"type":31,"value":209},{"type":25,"tag":87,"props":297,"children":299},{"class":89,"line":298},12,[300,304,308,313],{"type":25,"tag":87,"props":301,"children":302},{"style":136},[303],{"type":31,"value":191},{"type":25,"tag":87,"props":305,"children":306},{"style":194},[307],{"type":31,"value":222},{"type":25,"tag":87,"props":309,"children":310},{"style":200},[311],{"type":31,"value":312}," locations",{"type":25,"tag":87,"props":314,"children":315},{"style":206},[316],{"type":31,"value":209},{"type":25,"tag":87,"props":318,"children":320},{"class":89,"line":319},13,[321,325,329,334],{"type":25,"tag":87,"props":322,"children":323},{"style":136},[324],{"type":31,"value":191},{"type":25,"tag":87,"props":326,"children":327},{"style":194},[328],{"type":31,"value":222},{"type":25,"tag":87,"props":330,"children":331},{"style":200},[332],{"type":31,"value":333}," websites",{"type":25,"tag":87,"props":335,"children":336},{"style":206},[337],{"type":31,"value":209},{"type":25,"tag":87,"props":339,"children":341},{"class":89,"line":340},14,[342],{"type":25,"tag":87,"props":343,"children":344},{"style":94},[345],{"type":31,"value":346},"}\n",{"type":25,"tag":26,"props":348,"children":350},{"id":349},"_3-populating-from-database",[351],{"type":31,"value":352},"3. Populating from Database",{"type":25,"tag":34,"props":354,"children":355},{},[356,358,364],{"type":31,"value":357},"Assign the roadmap item to the appropriate reviewer(s). Mark the spec ",{"type":25,"tag":83,"props":359,"children":361},{"className":360},[],[362],{"type":31,"value":363},"In Review",{"type":31,"value":365}," in the Docs database.",{"type":25,"tag":26,"props":367,"children":369},{"id":368},"_4-accessing-postgresql-database",[370],{"type":31,"value":371},"4. Accessing PostgreSQL Database",{"type":25,"tag":76,"props":373,"children":375},{"className":78,"code":374,"language":80,"meta":10,"style":10},"docker exec -it eventwebservice-postgres-1 psql -U postgres -d events\n",[376],{"type":25,"tag":83,"props":377,"children":378},{"__ignoreMap":10},[379],{"type":25,"tag":87,"props":380,"children":381},{"class":89,"line":90},[382,388,393,398,402,407,411,417,422,426,431,436,440],{"type":25,"tag":87,"props":383,"children":385},{"style":384},"--shiki-default:#D8DEE9FF;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2",[386],{"type":31,"value":387},"docker exec ",{"type":25,"tag":87,"props":389,"children":390},{"style":136},[391],{"type":31,"value":392},"-",{"type":25,"tag":87,"props":394,"children":395},{"style":384},[396],{"type":31,"value":397},"it eventwebservice",{"type":25,"tag":87,"props":399,"children":400},{"style":136},[401],{"type":31,"value":392},{"type":25,"tag":87,"props":403,"children":404},{"style":384},[405],{"type":31,"value":406},"postgres",{"type":25,"tag":87,"props":408,"children":409},{"style":136},[410],{"type":31,"value":392},{"type":25,"tag":87,"props":412,"children":414},{"style":413},"--shiki-default:#B48EAD;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF",[415],{"type":31,"value":416},"1",{"type":25,"tag":87,"props":418,"children":419},{"style":384},[420],{"type":31,"value":421}," psql ",{"type":25,"tag":87,"props":423,"children":424},{"style":136},[425],{"type":31,"value":392},{"type":25,"tag":87,"props":427,"children":428},{"style":194},[429],{"type":31,"value":430},"U",{"type":25,"tag":87,"props":432,"children":433},{"style":384},[434],{"type":31,"value":435}," postgres ",{"type":25,"tag":87,"props":437,"children":438},{"style":136},[439],{"type":31,"value":392},{"type":25,"tag":87,"props":441,"children":442},{"style":384},[443],{"type":31,"value":444},"d events\n",{"type":25,"tag":34,"props":446,"children":447},{},[448],{"type":25,"tag":64,"props":449,"children":451},{"alt":66,"src":450},"https:\u002F\u002Fprod-files-secure.s3.us-west-2.amazonaws.com\u002F2dc11d34-bac0-4492-87c3-597b450b63f7\u002Fe829d5e7-cc01-4117-b9c3-03869f626102\u002FUntitled.png",[],{"type":25,"tag":34,"props":453,"children":454},{},[455],{"type":25,"tag":64,"props":456,"children":458},{"alt":66,"src":457},"https:\u002F\u002Fprod-files-secure.s3.us-west-2.amazonaws.com\u002F2dc11d34-bac0-4492-87c3-597b450b63f7\u002F023ca088-81d5-4ab9-9107-3493dd2521ee\u002FUntitled.png",[],{"type":25,"tag":26,"props":460,"children":462},{"id":461},"_5-exploring-data-with-pg-admin",[463],{"type":31,"value":464},"5. Exploring data with PG Admin",{"type":25,"tag":34,"props":466,"children":467},{},[468],{"type":25,"tag":64,"props":469,"children":471},{"alt":66,"src":470},"https:\u002F\u002Fprod-files-secure.s3.us-west-2.amazonaws.com\u002F2dc11d34-bac0-4492-87c3-597b450b63f7\u002F4b959f86-d700-41cc-9737-89b5b831285c\u002FUntitled.png",[],{"type":25,"tag":34,"props":473,"children":474},{},[475],{"type":31,"value":476},"Need to connect to the Docker server for the postgres",{"type":25,"tag":76,"props":478,"children":480},{"className":78,"code":479,"language":80,"meta":10,"style":10},"docker inspect 0e75a583e38a | grep IPAddress\n",[481],{"type":25,"tag":83,"props":482,"children":483},{"__ignoreMap":10},[484],{"type":25,"tag":87,"props":485,"children":486},{"class":89,"line":90},[487,492,497,502],{"type":25,"tag":87,"props":488,"children":489},{"style":384},[490],{"type":31,"value":491},"docker inspect 0e75a583e38a ",{"type":25,"tag":87,"props":493,"children":494},{"style":136},[495],{"type":31,"value":496},"|",{"type":25,"tag":87,"props":498,"children":499},{"style":384},[500],{"type":31,"value":501}," grep ",{"type":25,"tag":87,"props":503,"children":504},{"style":194},[505],{"type":31,"value":506},"IPAddress\n",{"type":25,"tag":34,"props":508,"children":509},{},[510],{"type":25,"tag":64,"props":511,"children":513},{"alt":66,"src":512},"https:\u002F\u002Fprod-files-secure.s3.us-west-2.amazonaws.com\u002F2dc11d34-bac0-4492-87c3-597b450b63f7\u002Fb273a265-35d6-465f-9441-94b702124ec9\u002FUntitled.png",[],{"type":25,"tag":34,"props":515,"children":516},{},[517],{"type":31,"value":518},"add the details to connect to the server\nHappy coding, folks!",{"type":25,"tag":520,"props":521,"children":522},"style",{},[523],{"type":31,"value":524},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":10,"searchDepth":106,"depth":106,"links":526},[],"markdown","content:blog:2023:09:17:spring-boot-postgresql.md","content","blog\u002F2023\u002F09\u002F17\u002Fspring-boot-postgresql.md","blog\u002F2023\u002F09\u002F17\u002Fspring-boot-postgresql","md",{"loc":5}]