Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Java: Spring Boot
(edit)
Revision as of 15:54, 30 April 2022
262 bytes added
,
15:54, 30 April 2022
m
→/pom.xml
Line 142:
Line 142:
</dependencies>
</dependencies>
....
....
−
</syntaxhighlight>
+
</syntaxhighlight
>To run against a MySQL instead of H2 replace the h2 dependency by:<syntaxhighlight lang="xml"
>
−
+
....
+
<dependency>
+
<groupId>mysql</groupId>
+
<artifactId>mysql-connector-java</artifactId>
+
</dependency>
+
....
+
</syntaxhighlight><br />
===/src/main/resources/application.properties===
===/src/main/resources/application.properties===
−
==== h2 Database ====
+
====h2 Database====
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.url=jdbc:h2:mem:testdb
Line 154:
Line 160:
</syntaxhighlight>database will be accessible via http://localhost:8080/h2-console
</syntaxhighlight>database will be accessible via http://localhost:8080/h2-console
−
==== Docker MySQL ====
+
====Docker MySQL====
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
#spring.datasource.url=jdbc:h2:mem:testdb
#spring.datasource.url=jdbc:h2:mem:testdb
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version