Javaでdbを使用する方法
1491 ワード
JDBCとは?
https://shs2810.tistory.com/18
何が連絡を解除しますか?
https://minkwon4.tistory.com/168
DataSourceとは?
https://deepweller.tistory.com/6
HikariCPとは?
mariadbスプリングガイドで使用する方法
application.properties:データソースの設定spring.datasource.driverClassName=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/테이블이름
spring.datasource.username=root
spring.datasource.password=패스워드
build.gralde:次の2つの依存項目を追加// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.6.4'
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.3'
AppConfig.class:beanの追加@Configuration
@ComponentScan
public class AutoAppConfig {
private final DataSource dataSource;
public AutoAppConfig(DataSource dataSource){
this.dataSource = dataSource;
}
}
Reference
この問題について(Javaでdbを使用する方法), 我々は、より多くの情報をここで見つけました
https://velog.io/@jun112465/java에서-db를-사용하는-방법
テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol
https://minkwon4.tistory.com/168
DataSourceとは?
https://deepweller.tistory.com/6
HikariCPとは?
mariadbスプリングガイドで使用する方法
application.properties:データソースの設定spring.datasource.driverClassName=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/테이블이름
spring.datasource.username=root
spring.datasource.password=패스워드
build.gralde:次の2つの依存項目を追加// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.6.4'
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.3'
AppConfig.class:beanの追加@Configuration
@ComponentScan
public class AutoAppConfig {
private final DataSource dataSource;
public AutoAppConfig(DataSource dataSource){
this.dataSource = dataSource;
}
}
Reference
この問題について(Javaでdbを使用する方法), 我々は、より多くの情報をここで見つけました
https://velog.io/@jun112465/java에서-db를-사용하는-방법
テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol
mariadbスプリングガイドで使用する方法
application.properties:データソースの設定spring.datasource.driverClassName=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/테이블이름
spring.datasource.username=root
spring.datasource.password=패스워드
build.gralde:次の2つの依存項目を追加// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.6.4'
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.3'
AppConfig.class:beanの追加@Configuration
@ComponentScan
public class AutoAppConfig {
private final DataSource dataSource;
public AutoAppConfig(DataSource dataSource){
this.dataSource = dataSource;
}
}
Reference
この問題について(Javaでdbを使用する方法), 我々は、より多くの情報をここで見つけました
https://velog.io/@jun112465/java에서-db를-사용하는-방법
テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol
spring.datasource.driverClassName=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/테이블이름
spring.datasource.username=root
spring.datasource.password=패스워드
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.6.4'
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.3'
@Configuration
@ComponentScan
public class AutoAppConfig {
private final DataSource dataSource;
public AutoAppConfig(DataSource dataSource){
this.dataSource = dataSource;
}
}
Reference
この問題について(Javaでdbを使用する方法), 我々は、より多くの情報をここで見つけました https://velog.io/@jun112465/java에서-db를-사용하는-방법テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol