반응형

데이터베이스 3

코틀린 라이브러리 및 프레임 워크

1. 안드로이드 개발 - 안드로이드 개발에 가장 많이 사용되는 코틀린 라이브러리 중 하나는 Retrofit이다. Retrofit은 RESTful API와의 통신을 쉽게 구현할 수 있도록 도와주는 라이브러리이다. 다음은 Retrofit을 사용한 예제이다. // Retrofit 인스턴스 생성 val retrofit = Retrofit.Builder() .baseUrl("https://api.example.com/") .addConverterFactory(GsonConverterFactory.create()) .build() // API 인터페이스 정의 interface ApiService { @GET("users/{id}") fun getUser(@Path("id") userId: String): Call ..

Kotlin 2023.09.20

JPA 에 대한 설명 및 예제

JPA(Java Persistence API)는 자바 객체와 관계형 데이터베이스를 매핑해주는 ORM(Object-Relational Mapping) 프레임워크로, 개발자가 SQL 쿼리를 작성하지 않고도 객체 지향적인 방식으로 데이터베이스를 조작할 수 있게 도와줍니다. JPA를 사용하면 클래스와 테이블, 객체와 레코드 간의 매핑을 어노테이션을 통해 설정할 수 있으며, CRUD(Create, Read, Update, Delete) 연산을 메서드 호출만으로 처리할 수 있습니다. 아래는 JPA를 사용하여 간단한 예제를 작성한 코드입니다. - Entity 클래스 import javax.persistence.Entity; import javax.persistence.GeneratedValue; import java..

Springboot 2023.09.18

오라클 연동 및 예제

오라클과 Spring Boot를 연동하는 방법은 다음과 같습니다. 1. Dependency 추가 - Maven을 사용하는 경우, pom.xml 파일에 아래의 의존성을 추가합니다. org.springframework.boot spring-boot-starter-jdbc com.oracle.database.jdbc ojdbc8 19.11.0.0 2. application.properties 설정 - Spring Boot 애플리케이션의 resources 디렉토리에 있는 application.properties 파일에 다음과 같이 Oracle 데이터베이스 연결 정보를 설정합니다. # Oracle Connection spring.datasource.url=jdbc:oracle:thin:@localhost:1521..

Springboot 2023.09.18
반응형