티스토리 뷰
메이븐 pom.xml 사용할때
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>annotationProcessor</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version><!--$NO-MVN-MAN-VER$-->
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.persistence/javax.persistence -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
</dependencies>
|
cs |
DatabaseConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package com.bitcamp.web;
import org.h2.server.web.WebServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* DatabaseConfig
*/
@Configuration
public class DatabaseConfig {
@Bean
public ServletRegistrationBean h2servletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet());
registration.addUrlMappings("/console/*");
return registration;
}
}
|
cs |
application.properties
1
2
|
spring.mvc.view.prefix=/
spring.mvc.view.suffix=.html
|
cs |
application.yml
1
2
3
4
5
6
7
8
|
spring:
datasource:
url: jdbc:h2:mem:testdb;
driverClassName: org.h2.Driver
username: sa
password:
jpa:
database-platform: org.hibernate.dialect.H2Dialect
|
cs |
data.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
DROP TABLE IF EXISTS customers;
CREATE TABLE customers (
id INT AUTO_INCREMENT PRIMARY KEY,
customer_id VARCHAR(15) UNIQUE NOT NULL,
customer_name VARCHAR(15) NOT NULL,
pwd VARCHAR(50) NOT NULL,
ssn VARCHAR(50) UNIQUE NOT NULL,
phone VARCHAR(50) NOT NULL,
city VARCHAR(110) NOT NULL,
addr VARCHAR(110) NOT NULL,
postalcode VARCHAR(50) NOT NULL,
photo VARCHAR(50) DEFAULT 'defaut_photo'
)DEFAULT CHARSET=utf8;
commit;
|
cs |
'0. 정보통신' 카테고리의 다른 글
81540. 마이바티스 템플릿 (0) | 2020.05.29 |
---|---|
82540. 인텔리제이 스프링부트(spring boot) + 마이바티스(mybatis) + 하이버네이트(JPA) 최소 설정파일들 (0) | 2020.05.27 |
[스프링부트] 인텔리제이에서 프로젝트 생성하기 (0) | 2020.05.24 |
[이클립스] 스프링부트 + jQuery 프로젝트 생성 (0) | 2020.05.24 |
[부트] 질병관리 index.html ※ 템플릿 사용하지 않고 쉽게 시작 #40 (0) | 2020.05.24 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- mariadb
- COLAB
- maven
- Mlearn
- jQuery
- ERD
- Oracle
- intellij
- JUnit
- terms
- SpringBoot
- FLASK
- JPA
- Eclipse
- nodejs
- Java
- Django
- Python
- Git
- AWS
- KAFKA
- Algorithm
- SQLAlchemy
- database
- springMVC
- Mongo
- vscode
- docker
- tensorflow
- React
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함