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
On this page of the site you can watch the video online Creating Spring Boot Web Application Using VSCode Part-3 with a duration of hours minute second in good quality, which was uploaded by the user Let's Learn Together 12 September 2019, share the link with friends and acquaintances, this video has already been watched 1,331 times on youtube and it was liked by 10 viewers. Enjoy your viewing!