1.이클립스에서 Package Explorer

2.JRE System Library - Popup - Build Path - Configure Build Path클릭

3.Java Build Path - Libraries - Add External JARs..클릭

4. C:\Program Files (x86)\MySQL\Connector J 5.1.30\mysql-connector-java-5.1.30-bin 열기

 

블로그 이미지

왕왕왕왕

,

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.SQLException;

import java.sql.Statement;


public class DB_connect {


// 데이터베이스 연결

public Connection connection() {


Connection con = null;

String driverName = "org.gjt.mm.mysql.Driver";

String url = "jdbc:mysql://localhost:3306/pos";

String user = "root";

String password = "1352468";

try {

//드라이버 로드

Class.forName(driverName);

//연결

con = DriverManager.getConnection(url, user, password);


} catch (SQLException e) {

e.printStackTrace();

} catch (ClassNotFoundException e) {

// TODO 자동 생성된 catch 블록

e.printStackTrace();

}

//모두완료된 con을 리턴해줌

return con;

}


//Statement메소드

//connection메소드를 불러와 바로 연결하고 stmt생성한다.


public Statement statement() {

Connection con = connection();

Statement stmt = null;

try {

stmt = con.createStatement();

} catch (SQLException e) {

// TODO 자동 생성된 catch 블록

e.printStackTrace();

}

//완료된 stmt를 리턴한다.

return stmt;

}

}


//나중에 작성할 메소드에서는 statement메소드만 불러오면 연결과 stmt생성까지 한번에 한다.



'데이터베이스 > Mysql' 카테고리의 다른 글

sql 테이블 생성 및 제거  (0) 2014.05.15
user 계정생성 및 오류대처  (0) 2014.04.29
Mysql Client 에서 자주사용하는 명령어  (0) 2014.04.29
이클립스 Mysql 연결  (0) 2014.04.29
Mysql 설치  (0) 2014.04.28
블로그 이미지

왕왕왕왕

,

http://dev.mysql.com/

 

Mysql Community server 에서 운영체제 맞게 선택

 

기본 디폴트된 조건으로 설치(손댈 필요없음)

 

이클립스에서 쓰다가 Driver 관련 오류는 사이트에서 Mysql Connector 에서 Connector/J 다운

블로그 이미지

왕왕왕왕

,

리눅스 파티션

리눅스 2013. 12. 2. 02:47
1. 파티션 확인

 

    1)fdisk -l /dev/hda  

       -> /dev/hda 의 파티션 내용을 확인한다.생략하면 모든 하드드라이브의 파티션을 보여준다.

 

[root@linux root]#fdisk -l

 

 Disk /dev/hda: 80.0 GB, 80060424192 bytes
 255 heads, 63 sectors/track, 9733 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

 Device        Boot   Start   End         Blocks        Id    System
 /dev/hda1     * 1            3824         30716248+     7    HPFS/NTFS
 /dev/hda2            3825   5099         10241437+   83     Linux
 /dev/hda3            5100   5230         1052257+    82     Linux swap
 /dev/hda4            5231   9733         36170347+    5     Extended
 /dev/hda5            5231   7055         14659281     fd     Linux raid autodetect
 /dev/hda6            7056   8880         14659281     fd     Linux raid autodetect
 /dev/hda7            8881   9003         987966       83     Linux

 

 2.  파티션 활용

 

 1)fdisk 실행

 

 [root@linux root]#fdisk /dev/hda  -> /dev/hda 파티션을 설정하기위해 실행

  The number of cylinders for this disk is set to 9733.
  There is nothing wrong with that, but this is larger than 1024,
  and could in certain setups cause problems with: 
  1) software that runs at boot time (e.g., old versions of LILO)
  2) booting and partitioning software from other OSs
  (e.g., DOS FDISK, OS/2 FDISK)

  Command (m for help): p <-- 'p' 명령은 현재 파티션정보를 보여준다.('fdisk -l' 과 같음)  

 

  Disk /dev/hda: 80.0 GB, 80060424192 bytes
 255 heads, 63 sectors/track, 9733 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

 Device        Boot   Start   End         Blocks        Id    System
 /dev/hda1     * 1            3824         30716248+     7    HPFS/NTFS
 /dev/hda2            3825   5099         10241437+   83     Linux
 /dev/hda3            5100   5230         1052257+    82     Linux swap
 /dev/hda4            5231   9733         36170347+    5     Extended
 /dev/hda5            5231   7055         14659281     fd     Linux raid autodetect
 /dev/hda6            7056   8880         14659281     fd     Linux raid autodetect
 /dev/hda7            8881   9003         987966       83     Linux


 

 2)새 파티션 생성하기

 

  Command (m for help): n <-- 'n' 명령은 새파티션생성시 쓰인다.
  First cylinder (9004-9733, default 9004):  <-- 시작실린더지점지정 그냥[enter]하면 default값.
  Using default value 9004
  Last cylinder or +size or +sizeM or +sizeK (9004-9733, default 9733): +100m
   <-- 끝나는실린더지정 혹은 직접 사이즈 지정할수 있다.

 

  Command (m for help): p <-- 확인  

 

  Disk /dev/hda: 80.0 GB, 80060424192 bytes
 255 heads, 63 sectors/track, 9733 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

 Device        Boot   Start   End         Blocks        Id    System
 /dev/hda1     * 1            3824         30716248+     7    HPFS/NTFS
 /dev/hda2            3825   5099         10241437+   83     Linux
 /dev/hda3            5100   5230         1052257+    82     Linux swap
 /dev/hda4            5231   9733         36170347+    5     Extended
 /dev/hda5            5231   7055         14659281     fd     Linux raid autodetect
 /dev/hda6            7056   8880         14659281     fd     Linux raid autodetect
 /dev/hda7            8881   9003         987966       83     Linux

 /dev/hda8            9004   9016         104391       83     Linux

   새로 생성된 파티션

 

 3) 파티션 삭제

 

 Command (m for help): d <-- 'd'명령은 파티션을 삭제하는 명령.

 

 Command (m for help): p <-- 확인  

 

  Disk /dev/hda: 80.0 GB, 80060424192 bytes
 255 heads, 63 sectors/track, 9733 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

 Device        Boot   Start   End         Blocks        Id    System
 /dev/hda1     * 1            3824         30716248+     7    HPFS/NTFS
 /dev/hda2            3825   5099         10241437+   83     Linux
 /dev/hda3            5100   5230         1052257+    82     Linux swap
 /dev/hda4            5231   9733         36170347+    5     Extended
 /dev/hda5            5231   7055         14659281     fd     Linux raid autodetect
 /dev/hda6            7056   8880         14659281     fd     Linux raid autodetect
 /dev/hda7            8881   9003         987966       83     Linux

 

 4)파티션의 system`id 지정

 

Command (m for help): t <-- ' t ' 명령은 system`id지정하는 명령
Partition number (1-8): 8 <-- 파티션 선택 (8은 /dev/hda8)
Hex code (type L to list codes): L <-- ' L ' 명령은 system`id 의 LIST 를 보여준다.


0 Empty                    1c Hidden Win95 FA  70 DiskSecure Mult bb Boot Wizard hid
1 FAT12                    1e Hidden Win95 FA  75 PC/IX be Solaris boot
2 XENIX root              24 NEC DOS            80 Old Minix c1 DRDOS/sec (FAT-
3 XENIX usr               39 Plan 9                 81 Minix / old Lin c4 DRDOS/sec (FAT-
7 HPFS/NTFS            42 SFS                   85 Linux extended db CP/M / CTOS / .

                                               *

                                               *

                                               *

                                               *

                                               *
17 Hidden HPFS/NTF  63 GNU HURD or Sys ab Darwin boot fd Linux raid auto
18 AST SmartSleep     64 Novell Netware    b7 BSDI fs fe LANstep
1b Hidden Win95 FA    65 Novell Netware    b8 BSDI swap ff BBT


 

Hex code (type L to list codes): fd <-- 원하는 코드를 입력 (fd  는 raid 이다)
Changed system type of partition 8 to fd (Linux raid autodetect)

 

Command (m for help): p <-- 확인  

 

  Disk /dev/hda: 80.0 GB, 80060424192 bytes
 255 heads, 63 sectors/track, 9733 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

 Device        Boot   Start   End         Blocks        Id    System
 /dev/hda1     * 1            3824         30716248+     7    HPFS/NTFS
 /dev/hda2            3825   5099         10241437+   83     Linux
 /dev/hda3            5100   5230         1052257+    82     Linux swap
 /dev/hda4            5231   9733         36170347+    5     Extended
 /dev/hda5            5231   7055         14659281     fd     Linux raid autodetect
 /dev/hda6            7056   8880         14659281     fd     Linux raid autodetect
 /dev/hda7            8881   9003         987966       83     Linux
 /dev/hda8            9004   9016         104391        fd    Linux raid autodetect

                                                                      system`id 가 변경됨을 알수 있다.

 

 5) 파티션 저장 하고 나가기

 

   Command (m for help): w <--' w ' 명령은 작업한 파티션정보를 저장하고 나가는 명령

  The partition table has been altered!

  Calling ioctl() to re-read partition table.

  WARNING: Re-reading the partition table failed with error 16: 장치나 자원이 동작 중.
  The kernel still uses the old table.
  The new table will be used at the next reboot.
  Syncing disks.
  [root@mail root]#

   ※저장후 재부팅해야 인식한다.

 

 6) 파티션 저장안하고 나가기

  

   Command (m for help): q <--' q ' 명령은 작업한 파티션정보를 저장하지않고 나가는 명령

 

  [root@mail root]#

 

 7) 기타 fdisk 내부에서 명령어 확인

 

  Command (m for help): m <-- 'm' 명령은 명령어들에 대한 도움말을 출력한다.
  Command action
  a toggle a bootable flag
  b edit bsd disklabel
  c toggle the dos compatibility flag
  d delete a partition
  l list known partition types
  m print this menu
  n add a new partition
  o create a new empty DOS partition table
  p print the partition table
  q quit without saving changes
  s create a new empty Sun disklabel
  t  change a partition's system id
  u change display/entry units
  v verify the partition table
  w write table to disk and exit
  x extra functionality (experts only)

출처 : bluetree`s linux

 

'리눅스' 카테고리의 다른 글

리눅스 기본명령어  (1) 2014.08.31
우분투 ftp  (0) 2014.06.24
apt-get  (0) 2014.06.05
diskpart 파티션  (0) 2013.12.02
vi 편집기 여러줄 주석처리  (0) 2013.11.22
블로그 이미지

왕왕왕왕

,

diskpart 파티션

리눅스 2013. 12. 2. 02:33

윈도우 7,8 파티션 나누기( vista 이상부터 사용가능)

프롬프트 창에서 diskpart 사용하면 새로운 창이 열림

프롬프트상에서 하는 것이 안전성이 있다고합니다.

 

DISKPART> list disk

디스크 목록

DISKPART> select disk 0

0번째 디스크 선택

DISKPART>list partition

0번째 디스크의 파티션 목록

DISKPART> select partition 1

0번째 디스크의 1번째 파티션 선택

DISKPART> active

번째 디스크의 1번째 파티션, 활성화(= 비활성화는 inactive)

----------------------------------------

DISKPART> create partition primary size=100

주 파티션으로 100MB을 만든다.

(최대 주 파티션 3, 논리 파티션 1: 4개 이상의 파티션을 만들려면 무조건 확장파티션이 있어야 됨)

DISKPART> list volume

볼륨 목록

DISKPART> create partition logical size=250

논리 파티션으로 250MB를 만든다.

DISKPART> create partition extended

확장 파티션 만들기

DISKPART> assign letter=c

드라이버 문자 지정

DISKPART> delete partition override

파티션 삭제

DISKPART> Format C:/fs:ntfs /Q

C드라이브, NTFS형식의 빠른 포맷

format fs=ntfs quick

nfts 로 빠른 포맷한다.

 

FS= [파일 시스템]

FAT32 FAT32 로 포맷

NTFS NTFS 로 포맷

exFAT exFAT 으로 포맷

 

 

'리눅스' 카테고리의 다른 글

리눅스 기본명령어  (1) 2014.08.31
우분투 ftp  (0) 2014.06.24
apt-get  (0) 2014.06.05
리눅스 파티션  (0) 2013.12.02
vi 편집기 여러줄 주석처리  (0) 2013.11.22
블로그 이미지

왕왕왕왕

,
명령 모드에서
V를 누르게 되면 하단에 Visual이라는 메세지가 출력됨 그 상태에서 주석 처리할 줄을 선택한 후에

:normal i#
-> # : 추가할 문자


주석 지울 시에는 V를 눌러 Visual로 전환후 주석 제거할 줄 선택 후
:normal 2x
-> 2는 선택된 줄의 왼쪽으로 부터 몇번째 문자
-> x는 삭제를 의미


1v, 2v 이런식으로 v명령어 앞에 숫자를 붙여서 사용할수도 있으며
1v 는 20줄 선택 2v는 40줄 선택 이런식으로 20줄씩 증가
 

 

'리눅스' 카테고리의 다른 글

리눅스 기본명령어  (1) 2014.08.31
우분투 ftp  (0) 2014.06.24
apt-get  (0) 2014.06.05
리눅스 파티션  (0) 2013.12.02
diskpart 파티션  (0) 2013.12.02
블로그 이미지

왕왕왕왕

,

sudo apt-get install oracle-java7-installer

'하둡' 카테고리의 다른 글

Hadoop 분산처리모드  (0) 2015.08.20
Hadoop hdfs 개념과 url로 데이터 읽기  (0) 2015.08.20
Hadoop 설치  (0) 2015.08.20
sudo,su , su-  (0) 2014.06.05
rsync 리눅스 동기화  (0) 2014.06.05
블로그 이미지

왕왕왕왕

,

_beginthreadex() 사용시 에러 해결

 

비주얼 6.0에서는 라이브러리 기본 상태가 단일 스레드로 설정되있기때문에 에러가 난다.

 

Project - setting

 

 

 

블로그 이미지

왕왕왕왕

,