가자공부하러!

1. DB설치, 개발환경 구축 (Oracle DB, Maria DB) 본문

공부/DB

1. DB설치, 개발환경 구축 (Oracle DB, Maria DB)

오피스엑소더스 2019. 5. 29. 12:38

참고사이트


1. Oracle DB

2. Maria DB

  > Maria DB 설치 : https://alpreah.tistory.com/76?category=844976

  > Maria DB와 Spring MyBatis 연결 : https://alpreah.tistory.com/77

  > STS 기본 설정과 pom.xml 사용 방법 : https://alpreah.tistory.com/75?category=844976

  > Spring을 활용한 간단한 로그인 예제 : https://alpreah.tistory.com/80

3. Spring 개발환경 구축

  > https://dotheright.tistory.com/164



Oracle DB



1. Oracle DB 설치

  > 다운로드 https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

  > 인스톨 ( Setup.exe )

  > 작동확인 : cmd > sqlplus sys/admin as sysdba

  > 시작 : https://blog.naver.com/PostView.nhn?blogId=kimdj217&logNo=221405032563&parentCategoryNo=&categoryNo=34&viewDate=&isShowPopularPosts=false&from=postView

 

 

 

2. SQL Developer 설치

  > 다운로드 https://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html 

  > 인스톨 ( sqldeveloper.exe )

  > jdk 경로 설정

  > 실행

 

3. 메이저 DB와 개발 툴

  [MS피셜]

  > MySQL - Workbench

  > 몽고 - 로보몽고

 

 

4. 결과

  > 18c 십팔씨버전으로 했는데 관련 내용이 웹상에 많지 않음

  > 11g로 바꿔서 실행 및 테이블 생성 성공

 

5. 이클립스 연동

  > https://raccoonjy.tistory.com/20

  > Database Configuration Assistant에서 DB생성

  > Net Configuration Assistant에서 리스너+서버설정

  > 이클립스에 DBeaver 설치(Market Place)

  > 자바프로젝트 우클릭 - Properties -Java Build Path - Libraries - Add External JARs... - ojdbc6.jar - apply

  > 테스트(DriveManager.getConnection())

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
import java.sql.*;
 
public class DBConnectionTest {
    public static void main(String[] args) {
        connectionDB();
    }
    public static void connectionDB() {
        Connection con = null;
        
        String user = "minhj";
        String pw = "****";
        String url = "jdbc:oracle:thin:@localhost:1521:studyDB";
        
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            con = DriverManager.getConnection(url, user, pw);
            System.out.println("DB연결 성공!");
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("실패");
        } finally {
            try {
                if( con != null)
                    con.close();
            }catch(Exception e) {
                
            }
        }
    }
}
 
cs




Maria DB



1. Maria DB 다운로드

  > https://downloads.mariadb.org/


2. Setup

   > Default instance properties

- Modify password for database user 'root'

- root계정 비밀번호 설정

- Use UTF8 as default server's character set 체크 필수

- Install as service check(default)

- Service Name : MariaDB(default)

- Enable networking check(default)

- TCP port : 3306(default)

- Innodb engine settings

- Buffer pool size : 996MB(default)

- Page size : 16KB(default)

- Enable the Feedback plugin... uncheck(default)

  

3. 설치 성공여부 확인

  > HeidiSQL 실행

- 좌측하단 신규 버튼 클릭

- 암호 입력

- 열기 버튼 클릭

- 결과화면 확인(아래 사진)









Comments