Monday, December 10, 2018

Spring-boot2-pool-conexion

I share example, Spring Boot2 pool conexion from Tomcat.

Technologies used:

1. Spring Boot 2.0.3.RELEASE
2. Maven 4
3. Java 9
4. Eclipse: Oxygen.1.a Release (4.7.1a)
5. Tomcat 9
6. MySql 5.7.24


Steps:

1. Create table and insert on table.

CREATE TABLE `user` (
  `id` bigint(20) NOT NULL,
  `name` varchar(45) DEFAULT NULL,
  `email` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `user` (`id`, `name`, `email`) VALUES ('1', 'Henry', 'test@gmail.com');
INSERT INTO `user` (`id`, `name`, `email`) VALUES ('2', 'Juan', 'test2@gmail.com');


2. Import maven project from eclipse.
3. edit configuration file .yml



4. Run  As -> Run on Server

5. For test: http://localhost:8080/spring2-pool-conexion/user



Code on GitHub:
https://github.com/HenryXiloj/Spring-boot2-pool-conexion

References:

https://www.concretepage.com/spring-boot/spring-boot-tomcat-connection-pool


No comments:

Post a Comment

Virtual Threads in Java 21: Simplified Concurrency for Modern Applications

  With Java 21, Virtual Threads have redefined how we approach concurrency, offering a lightweight and efficient way to handle parallel and ...