MyEnvironment:
MAMP (mysql server) with mysql workbench
VScode with java support extension.
System Requirements:
Java,
Maven,
MySQL Server (Database)
Visual Studio Code
Brief Overview of:
IntelliJ IDEA (Professional Edition vs Community edition)
Eclipse (SpringToolSuite) (Good for beginners)
VS-Code (text editor supported by extensions/ plug-ins)
class creation in vscode vs the other two
To check Java and Maven is installed:
java -version
mvn -v (man = maven)
Some useful VS-code extensions for Java:
VS-Code extensions for Java and Spring Boot:
Spring Boot Extension Pack (https://marketplace.visualstudio.com/...)
Language support for Java by RedHat(https://marketplace.visualstudio.com/...)
Maven for Java by Microsoft (https://marketplace.visualstudio.com/...)
Java Extension Pack by Microsoft (https://marketplace.visualstudio.com/...)
Spring Initializr Java by Microsoft
Debugger for Java by Microsoft
Spring Boot Dashboard for VS code (https://marketplace.visualstudio.com/...)
About the first CRUD (Create, Read, Update, Delete) application:
We have a company called XCARS. In order to be innovative, we want our employees to share their ideas-
about new feature that a new modern car can have.
Our Companies Website:
ideas.xcars.com
the reverse domain name will become: com.xcars.ideas
Action I:
Downloading Spring Boot package from https://start.spring.io/
Some additional link to Maven and Spring Boot.
mvn package
java -jar target/myproject-0.0.1-SNAPSHOT.jar
java -jar build/libs/gs-accessing-data-mysql-0.1.0.jar
(https://spring.io/guides/gs/accessing...)
(https://docs.spring.io/spring-boot/do...)
mvn spring-boot:run (start the downloaded package)
Dependencies:
mysql, web-starter, hibernate(JPA), devTools
To render webpage:
jstl, tomcat jasper
JSP/JSTL:
https://www.javaworld.com/article/333...
https://www.tutorialspoint.com/jsp/js...
https://www.baeldung.com/jstl
https://www.studytonight.com/jsp/jstl...
To run the project:
MySQL configuration needs to be added to application.properties
Link: (https://spring.io/guides/gs/accessing...)
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example
spring.datasource.username=springuser
spring.datasource.password=ThePassword
none: This is the default for MySQL, no change to the database structure.
update: Hibernate changes the database according to the given Entity structures.
create: Creates the database every time, but don’t drop it when close.
create-drop: Creates the database then drops it when the SessionFactory closes.
MySQL:
Database creation: create schema ideas // or create database ideas.
create, drop, select
Building the web structure:
Building the structure: create a folder name it "webapp", inside it create another called it WEB-INF
/webapp/WEB-INF/index.jsp
Add in application.properties the preffix, suffix
create controller package inside project folder
Action II:
cmd +shift+ p
application.properties
En esta página del sitio puede ver el video en línea Creating Spring Boot Web Application Using VSCode Part-3 de Duración hora minuto segunda en buena calidad , que subió el usuario Let's Learn Together 12 septiembre 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,331 veces y le gustó 10 a los espectadores. Disfruta viendo!