■ 000000 / black 블랙
■ 2f4f4f / darkslategray
다크슬레이트그레이
■ 708090 / slategray 슬레이트그레이
■ 778899 / lightslategray 라이트슬레이트그레이
■ 696969 / dimgray 딤그레이
■ 808080 / gray 그레이
■ a9a9a9 / darkgray 다크그레이
■ c0c0c0 / silver 실버
■ d3d3d3 / lightgrey 라이트그레이
■ dcdcdc / gainsboro 게인스보로
■ ffffff / white 화이트
■ fff5ee / seashell 씨쉘
■ fffafa / snow 스노우
■ f8f8ff / ghostwhite 고스트화이트
■ fffaf0 / floralwhite 후로랄화이트
■ f5f5f5 / whitesmoke 화이트스모크
■ f0f8ff / aliceblue 앨리스블루
■ f0ffff / azure 애쥬어
■ fdf5e6 / oldlace 올드래이스
■ f5fffa / mintcream 민트크림
■ ffefd5 / papayawhip 파파야윕
■ ffdab9 / peachpuff 피치퍼프
■ faf0e6 / linen 린넨
■ eee8aa / palegoldenrod 팔레골덴로드
■ ffe4e1 / mistyrose 미스티로즈
■ ffe4b5 / moccasin 모카신
■ ffdead / navajowhite 나바조화이트
■ d2b48c / tan
■ f5deb3 / wheat 위트
■ fafad2 / lightgoldenrodyellow 라이트골덴로드옐로우
■ ffffe0 / lightyellow 라이트옐로우
■ fff8dc  /cornsilk 콘실크
■ faebd7 / antiquewhite 안티크화이트
■ f5f5dc / beige 베이지
■ fffacd  / lemonchiffon 레몬치폰
■ fffff0  / ivory 아이보리
■ f0e68c / khaki 카키
■ e6e6fa / lavender 라벤더
■ fff0f5 / lavenderblush 라벤더블러시
■ ffe4c4 / bisque 비스크
■ ffebcd / blanchedalmond 블란체달몬드
■ deb887 / burlywood 벌리우드
■ cd853f / peru 페루
■ 00ced1 / darkturquoise 다크터콰이즈
■ 00bfff / deepskyblue 딥스카이블루
■ 7fffd4 / aquamarine 아쿠아마린
■ 1e90ff / dodgerblue 도저블루
■ 00ffff / cyan 시안
■ f0fff0 / honeydew 허니듀
■ 87cefa / lightskyblue 라이트스카이블루
■ afeeee / paleturquoise 팔레터콰이즈
■ e0ffff / lightcyan 라이트시안
■ add8e6 / lightblue 라이트블루
■ add8e6 /  lightsteelblue
라이트스틸블루
■ 40e0d0 / turquoise 터콰이즈
■ 48d1cc / mediumturquoise 미디엄터콰이즈
■ 00ffff / aqua 아쿠아
■ 7b68ee / mediumslateblue 미디움슬레이트블루
■ 191970 / midnightblue 미드나이트블루
■ 6495ed / cornflowerblue 콘플라워블루
■ 0000cd / mediumblue 미디움블루
■ 6a5acd / slateblue 슬레이트블루
■ 4682b4 / steelblue 스틸블루
■ 0000ff / blue 블루
■ 483d8b / darkslateblue 다크슬레이트블루
■ 5f9ea0 / cadetblue 카뎃블루
■ 87ceeb / skyblue 스카이블루
■ 4169e1 / royalblue 로열블루
■ b0e0e6 / powderblue 파우더블루
■ 000080 / navy 네이비
■ 00008b / darkblue 다크블루
■ 8a2be2 / blueviolet 블루바이올렛
■ 8b008b / darkmagenta 다크마그네타
■ 9932cc  / darkorchid 다크오치드
■ 9400d3 / darkviolet 다크바이올렛
■ ff00ff / magenta 마그네타
■ ff00ff / fuchsia
퍼츠샤
■ c71585 / mediumvioletred 미디움바이올렛레드
■ ba55d3 / mediumorchid 미디움오치드
■ 9370db / mediumpurple 미디움퍼플
■ dc143c / crimson 크림슨
■ ff1493 / deeppink 딥핑크
■ ffb6c1 / lightpink 라이트핑크
■ ff69b4 / hotpink 핫핑크
■ ffc0cb / pink 핑크
■ dda0dd / plum 플럼
■ 800080 / purple 퍼플
■ ee82ee / violet 바이올렛
■ d8bfd8 / thistle 디스틀
■ da70d6  / orchid 오치드
■ 4b0082 / indigo 인디고
■ a52a2a / brown 브라운
■ e9967a / darksalmon 다크샐몬
■ f08080  / lightcoral 라이트코랄
■ cd5c5c / indianred 인디안레드
■ ffa07a / lightsalmon 라이트샐몬
■ db7093 / palevioletred 팔레바이올렛레드
■ f4a460 / sandybrown 샌디브라운
■ fa8072 / salmon 샐몬
■ ff6347 / tomato 토마토
■ ff4500 / orangered 오렌지레드
■ ff0000 / red 레드
■ 800000 / maroon 마룬
■ 8b0000 / darkred 다크레드
■ b22222 / firebrick 파이어브릭
■ d2691e / chocolate 초콜렛
■ 8b4513 / saddlebrown 새들브라운
■ a0522d  / sienna 시에나
■ bc8f8f / rosybrown 로지브라운
■ ff7f50  / coral 코랄
■ ff8c00  /darkorange 다크오렌지
■ ffa500 / orange 오렌지
■ b8860b /  darkgoldenrod 다크골덴로드
■ ffd700 / gold 골드
■ ffff00 / yellow 옐로우
■ 7fff00 / chartreuse 차트리우스
■ 7cfc00 / lawngreen 라운그린
■ 00ff00 / lime 라임
■ 32cd32 / limegreen 라임그린
■ 00ff7f / springgreen 스프링그린
■ 3cb371 / mediumseagreen 미디움씨그린
■ adff2f / greenyellow 그린옐로우
■ 8fbc8f / darkseagreen 다크씨그린
■ 0ee90 / lightgreen 라이트그린
■ 8fb98 / palegreen 팔레그린
■ 9acd32 / yellowgreen 옐로우그린
■ 2e8b57  /seagreen 씨그린
■ 00fa9a / mediumspringgreen 미디움스프링그린
■ 20b2aa / lightseagreen 라이트씨그린
■ 66cdaa / mediumaquamarine 미디움아쿠아마린
■ 228b22 / forestgreen 포레스트그린
■ 008b8b / darkcyan 다크시안
■ 008080 / teal
■ 006400 / darkgreen 다크그린
■ 556b2f / darkolivegreen 다크올리브그린
■ 008000 / green 그린
■ 808000 / olive 올리브
■ 6b8e23 / olivedrab 올리브드래브
■ bdb76b / darkkhaki 다크카이
■ daa520 / goldenrod 골덴로드

Posted by MR 손
,

response.sendRedirect("링크주소"); // 주소로 이동

str.length(); //글자길이 갯수 구하기

str.substring(3,7); //글자의 3에서 7번째까지 추출

str.append("문자열"); //str의 문자열에 추가

 

▷JSP 액션태그

 <jsp:forward>       다른페이지로 이동

 <jsp:include>       다른페이지를 페이지 안에 추가                                               <jsp:include page="url" flush="true" />

 <jsp:parma>         forward, include, plugin과 같이 사용되어 인자를 추가할때

 <jsp:plugin>         애플릿과 같이 클라이언트에서 사용되는 객체 삽입

 <jsp:useBean>     자바빈즈 사용

 <jsp:setProperty>  자바빈즈 프로피티의 값을 설정할때

 <jsp:getProperty>  자바빈즈 프로피티의 값을 얻는데 사용

 

▷토큰자르기 (java.util.*)

 String tel = "055-1234-5678";

 StringTokenizer str = new StringTokenizer(tel, "-");

 str.nextToken()  //055

 str.nextToken()  //1234

 str.nextToken()  //5678

 

▷파일 (java.io.*)

 -파일생성

 String filename = "c:\\aaaaa\\bbbbb\\test.txt";  //리눅스일때 \\->/

 File f = new File(filename);  //파일클래스 작성

 f.createNewFile();  //파일 생성

 

---------------------------------------------------------------공통코드

 

 -파일쓰기

 FileWriter fw = new FileWriter(filename);  //객체생성

 String data = "ㅇㅇㅇㅇㅇㅇㅇ";

 fw.write(data);  //파일쓰기

 fw.close();  //파일저장

 

-파일읽기

 

 FileReader fr = new FileReader(filename);  //리더객체생성

 BufferedReader br = new BufferedReader(fr);  //버퍼리더객체생성 - readLine();

 

String line;

 while((line=br.readLine()) != null){

    out.println(line + "<br>");  //여러줄 읽어오기

 }

 

 -파일정보보기

 f.getAbsolutePath();  //절대경로

 f.getName();  //파일이름

 f.getParent(); //파일위치한 경로

 f.length();  //파일크기

 

 -파일삭제

 

 if(f.exists()){  //파일이 존재하면

    f.delete();

    out.println("파일이 삭제되었습니다.");

 }else{

    out.println("파일이 없습니다.");

 }

 

▷형변환

 -String -> int

 String a="15";

 int b = Integer.parseInt(a);

 

 -int -> String

 int a=12;

 Integer  b=new Integer(a);  //Integer객체 선언

 String c = B.toString();  //toString() 형변환

 

 int fsize = (int)file1.length();

 filesize = String.valueOf(fsize);

 

▷세션

 if(session.getAttribute("sid")==null){  //세션값이 아무것도 없을때

   out.println("세션 정보가 없습니다.");

   session.setAttribute("sid", session.getId());  //임의의 세션id를 sid에 저장

   session.setAttribute("name", "이름");  //이름을 name세션에 저장

 

 }else{

   out.println("이브라우저에 대한 세션 ID는 " + session.getAttribute("sid")+ "입니다.");

   out.println("name에 저장된 값은 " + session.getAttribute("name") + "입니다.");

 }

 

 session.setMaxInactiveInterval(3600);  //세션 유지시간 (1시간동안)

 

▷쿠키

 -저장

 Cookie cook1 = new Cookie("name", "aaa");  //쿠키객체생성

 cook1.setPath="/";  //쿠키가 적용될 웹서버의 url 경로

 cook1.setMaxAge(60*60*24*365); //쿠키가 유지되는 시간(1년) -1일경우 삭제하지 않는한 영구

 response.addCookie(cook1);  //쿠키를 클라이언트에 세팅

 

 Cookie cook2 = new Cookie("mail", aaa@aaa.com);

 cook2.setPath="/";

 cook2.setMaxAge(60*60*24*356);

 response.addCookie(cook2);

 

 -가져오기

 try(

   Cookie[] cookies = request.getCookies();

   for(int i = 0; i < cookies.length; i++){

     out.println(cookies[i].getName() + "은" + cookies[i].getValue() + "입니다.

   }

 }catch (Exception e){

   out.println(e);

 }

 

 결과 : name은 aaa입니다. mail은 aaa@aaa.com 입니다. JSESSIONID은 asgh134goi1입니다. //브라우저 세션

 

 -삭제하기

 try{

   Cookie[] cookies = request.getCookies();

   for(int i=0; i< cookies.length; i++){

     Cookie cook = cookies[i];

     cook.setMaxAge(0);

     response.addCookie(cook);

   }

   out.println("쿠키가 삭제되었습니다.");

 }catch(Exception e){

   out.println(e);

 }

 

▷JDBC드라이브

 Class.forName("org.gjt.mm.mysql.Driver");

 -mysql

 Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "test", "pass");  //연결객체생성

 Statement stmt = conn.createStatement();  //스테이트먼트 객체생성

 ResultSet rs = stmt.executeUpdate("insert into test(id, age) values('aaa','123')");  //쿼리문실행

 rs.next();  //다음 리절트 셋 

[출처] JSP에서 자주사용되는 것들|작성자 다니엘

Posted by MR 손
,



<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>선택된 상태 표현하기</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css" media="screen">

body {

    margin: 0;                            /* 상하좌우 마진을 없앤다. */

    padding: 0;                            /* 상하좌우 패딩을 없앤다. */

    font-size: small;                    /* 기본 글꼴 크기를 small로 지정한다. */

    }

    

#nav{

    

    float: left;    /* li항목을 둘러싸고 있는 ul항목에 width를 설정하고, float 속성을 지정해야만 배경이 제대로 표시된다. */

    width: 720px;    /* 너비를 720픽셀로 지정한다. 전체 너비는 너비(720픽셀) + 왼쪽패딩(46픽셀) = 766픽셀이 됩니다. */

    

    width: 100%;    /* 너비를 브라우져 전체 너비로 지정한다. */

    margin: 0;    /* 상하좌우 마진을 없앤다. */

    padding: 10px 0 0 46px;    /* 컨텐츠를 상(10픽셀) 우(0픽셀) 하(0픽셀) 좌(46픽셀)만큼 들여쓴다. */

    list-style: none;    /* 리스트 스타일을 없앤다. */

    background: #ffcb2d url(img/nav_bg.gif) repeat-x top left;    /* 네비게이션 메뉴바가 입체적으로 보이도록 1픽셀짜리 nav_bg.gif 이미지를 위쪽에 깐다. */

}

 

#nav li{

    float: left;                /* 네비게이션 메뉴를 가로형으로 표시하기 위해서 float 속성을 사용한다. */

    margin: 0;                /* 상하좌우 마진을 없앤다. */

    padding: 0;                /* 상하좌우 패딩을 없앤다. */

    font-family: "Lucida Grande", sans-serif;        /* 글꼴을 설정한다. */

    font-size: 80%;                        /* 글꼴 크기를 기본 글꼴 크기의 80%로 설정한다. */

}

 

#nav a{

    float: left;                /* <a> 엘리먼트를 한 줄에 나오게 하기위하여 float 속성을 지정한다. */

    display: block;                /* 탭 전체를 클릭할 수 있도록 <a>엘리먼트에 display: block; 속성을 지정한다. */        

    margin: 0 1px 0 0;            /* 탭의 오른쪽에 1픽셀만큼의 공간이 생기도록 설정한다. */

    padding: 4px 8px;            /* 탭에 상하(4픽셀) 좌우(8픽셀)만큼의 패딩을 추가한다. */

    color: #333;                /* 컨텐츠 색상을 지정한다. */

    text-decoration: none;            /* 텍스트의 장식(여기서는 밑줄)을 없앤다. */

    border: 1px solid #9b8748;        /* #9b8748 색상의 1픽셀짜리 실선 테두리를 만든다. */

    border-bottom: none;            /* 아랫쪽 테두리를 없앤다. */

    background: #f9e9a9;            /* 배경색을 지정한다. */

    

    background: #9fe9a9 url(img/off_bg.gif) repeat-x top left;    /* 배경색(#9fe9a9)을 지정하고 배경이미지를 수평방향(repeat-x)으로 반복해서 깐다. */

}

/* #nav안에 a태그들 에게 hover 마우스가 올라갔을때 효과를 주라! */

#nav a:hover, body#intro #t-about a{

    font-weight: bolder;            /* 글꼴을 진하게 설정한다. */

    color: #333;                /* 컨텐츠 색상을 지정한다. */

    padding-bottom: 5px;            /* 바닥 패딩값을 4픽셀에서 5픽셀로 늘린다.배경 테두리선이 올라오게 되는 효과가 생긴다. */

    border-color: #727377;            /* 테두리 색상을 설정한다. */

    background: #fff url(img/on_bg.gif) repeat-x top left;        /* 배경색(#fff)을 지정하고 배경이미지를 수평방향(repeat-x)으로 반복해서 깐다. */

}

</style>

</head>

 

<body id="intro">

 

    <ul id="nav">

        <li id="t-intro"><a href="/">이 사이트에 대하여</a></li>

        <li id="t-about"><a href="about.html">회사 소개</a></li>

        <li id="t-news"><a href="news.html">새로운 소식</a></li>

        <li id="t-sponsors"><a href="sponsors.html">후원 안내</a></li>

    </ul>

 

</body>

</html>

Posted by MR 손
,

select employee_id,

first_name || ''|| last_name names,

decode(round((sysdate- hire_date)/365),5,'5년근속',10,'10년근속',round((sysdate - hire_date)/365)) work_years

from employees

order by employee_id;

 

 

select round((sysdate - hire_date)/365) as round

from employees;

 

select decode(manager_id, 108,'dlfrhdvkf',manager_id) as id

from employees ;

 

select employee_id, first_name, last_name

from employees

where employee_id = decode(:emp, null, employee_id, : emp)

and first_name = decode(:names , null, first_name, : names);

 

 

 

select country_id, case region_id when 1 then 'one'

when 2 then 'two'

when 3 then 'three'

else 'etc' end as case_region_id

from countries;

 

 

select department_id, department_name

from departments

where (department_id, manager_id )in (select department_id, employee_id

from employees

where manager_id is null);

 

 

select count(*)

from employees

where department_id in (select department_id

from departments

where manager_id is not null);

 

select count(*)

from employees emp

where exists (select 1

from departments dep where dep.manager_id is not null

and emp.department_id = dep.department_id);

 

 

 

select emp.first_name ||' '|| emp.last_name as emp_names

, emp.department_id

,(select dep.department_name

from departments dep where dep.department_id = emp.department_id )as dep_name

from employees emp;

 

select a.employee_id ,a.first_name || '' || a.last_name as names, a.salary,

round(b.avgs), b.maxs

from employees a,

(select avg(salary) avgs,

max (salary) maxs

from employees) b

where a.salary between b.avgs and b.maxs

order by a.salary desc;

 

select *

from (select employee_id, first_name, last_name, salary

from employees

order by salary desc)

where rownum <11;

Posted by MR 손
,

--innner join on 사용

select *

from employees a inner join jobs j

on a.job_id = j.job_id

where a.job_id like '%A%';

 

--inner join using 사용

select *

from employees a inner join jobs j

using (job_id)

where job_id like '%A%';

 

--가존 조인 outer 대신

select *

from employees emp , job_history jhis

where emp.employee_id = jhis.employee_id(+);

 

--left outer join on 사용

select *

from employees emp left outer join job_history jhis

on emp.employee_id = jhis.employee_id

where emp.employee_id like '%1%';

 

--right outer join using 사용

select *

from employees emp right outer join job_history jhis

using (employee_id);

 

--full outer join on 사용

select *

from job_history jhis full outer join employees emp

on emp.employee_id = jhis.employee_id

where emp.employee_id like '%1%';

 

--full outer join using 사용

select *

from job_history jhis full outer join employees emp

using (employee_id);

 

-- cross join on 카타시안 프로덕트

select *

from employees emp cross join departments dep

on emp.DEPARTMENT_ID = dep.DEPARTMENT_ID;

 

--서브쿼리 IN 연관성 없는 서브쿼리

select count(*)

from employees

where department_id IN (

select department_id

from departments

where manager_id IS NOT NULL

);

 

--서브쿼리 EXISTS 연관성 있는 서브쿼리

select count(*)

from employees emp

where EXISTS (

select 1

from departments dep

where dep.manager_id IS NOT NULL

AND emp.department_id = dep.department_id

);




Posted by MR 손
,
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?xml version="1.0" encoding="UTF-8" ?>
 
 
 
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
 
 
 
<sqlMap namespace="board">
    <typeAlias alias="boardVO" type="board.vo.BoardVO" />
    <typeAlias alias="commentVO" type="board.vo.CommentVO" />
    
 
    <!-- 리스트 조회시 where절 -->
 
    <sql id="board.where.getList">
        <isNotEmpty property="searchStr">
            <isEqual property="searchSelect" compareValue="title">
                AND title LIKE '%'||#searchStr#||'%'
            </isEqual>
            <isEqual property="searchSelect" compareValue="writer">
                AND writer LIKE '%'||#searchStr#||'%'
            </isEqual>
        </isNotEmpty>
    </sql>
 
    
 
    <!-- 상세정보 조회시 코멘트 같이 조회 -->
 
    <resultMap class="boardVO" id="boardInfoMap">
 
        <result property="no" column="no"/>
        <result property="groupNo" column="group_no"/>
        <result property="title" column="title"/>
        <result property="writer" column="writer"/>
        <result property="contents" column="contents"/>
        <result property="hit" column="hit"/>
        <result property="regdate" column="regdate"/>
        <result property="comments" select="board.getCommentList" column="no"/>
 
    </resultMap>
 
    
 
    <!-- board 시퀀스 구하기 -->
 
    <select id="getSeq" resultClass="int">
 
        SELECT board_seq.nextval
 
        FROM dual
 
    </select>
 
    
 
    <!-- 리스트 목록 조회 -->
 
    <select id="getList" parameterClass="boardVO" resultClass="boardVO">
 
        <![CDATA[
        SELECT     no,
                group_no groupNo,
                depth_no depthNo,
                title,
                writer,
                contents,
                hit,
                type,
                regdate
        FROM (
            SELECT /*+ index_desc(a board_pk)*/rownum rn, no, group_no, order_no, depth_no, title, writer, contents, hit, type, regdate
            FROM board a
            WHERE no > 0 AND rownum <= #end#
        )
        WHERE rn >= #begin# AND type=#type#
 
        ]]>
 
        <include refid="board.where.getList" />
 
        ORDER BY group_no DESC, order_no ASC
 
    </select>
 
    
 
    <!-- 게시글 등록 -->
 
    <insert id="insertBoard" parameterClass="boardVO">
 
        INSERT INTO board (no, group_no, order_no, depth_no, id, title, writer, contents, hit, type, regdate)
 
                    VALUES (#no#, #groupNo#, #orderNo#, #depthNo#, #id#, #title#, #writer#, #contents#, 0, #type#, sysdate)
 
    </insert>
 
    
 
    <!-- 전체게시글 수 구하기 -->
 
    <select id="getTotalRow" parameterClass="boardVO" resultClass="int">
 
        SELECT count(*)
 
        FROM board
 
        WHERE type=#type#
 
        <include refid="board.where.getList" />
 
    </select>
 
    
 
    <!-- 조회수 증가 -->
 
    <update id="updateHit" parameterClass="int">
 
        UPDATE board SET hit=hit+1
 
        WHERE no=#value#
 
    </update>
 
    
 
    <!-- 상세정보 조회 -->
 
    <select id="getInfo" parameterClass="int" resultMap="boardInfoMap">
 
        SELECT no, group_no, title, writer, contents, hit, regdate
 
        FROM board
 
        WHERE no=#value#
 
    </select>
 
    
 
    <!-- 부모글 정보 조회 -->
 
    <select id="getParentInfo" parameterClass="int" resultClass="boardVO">
 
        SELECT     group_no groupNo,
 
                order_no orderNo,
 
                depth_no depthNo
 
        FROM board
 
        WHERE no=#value#
 
    </select>
 
    
 
    <!-- 부모글 순서보다 큰 게시글 업데이트하기 -->
 
    <update id="updateDepthNo" parameterClass="boardVO">
 
        <![CDATA[
        UPDATE board SET order_no=order_no+1
        WHERE group_no=#groupNo# AND order_no > #orderNo#
 
        ]]>
 
    </update>
 
    
 
    <!-- 게시글 수정 -->
 
    <update id="updateBoard" parameterClass="boardVO">
 
        UPDATE board SET
 
                title=#title#,
 
                writer=#writer#,
 
                contents=#contents#
 
        WHERE no=#no#
 
    </update>
 
    
 
    <!-- 게시글 삭제 -->
 
    <delete id="deleteBoard" parameterClass="int">
 
        DELETE FROM board
 
        WHERE no=#value#
 
    </delete>
 
    
 
    <!-- 코멘트 시퀀스 얻기 -->
 
    <select id="getCommentSeq" resultClass="int">
 
        SELECT board_comment_seq.nextval
 
        FROM dual
 
    </select>
 
    
 
    <!-- 코맨트 작성 -->
 
    <insert id="insertComment" parameterClass="commentVO">
 
        INSERT INTO board_comment(no, board_no, id, writer, contents, regdate)
 
                VALUES (#no#, #boardNo#, #id#, #writer#, #contents#, sysdate)
 
    </insert>
 
    
 
    <!-- 코멘트 상세정보 -->
 
    <select id="getCommentInfo" parameterClass="int" resultClass="commentVO">
 
        SELECT     no,
 
                board_no boardNo,
 
                id,
 
                writer,
 
                contents,
 
                regdate
 
        FROM board_comment
 
        WHERE no=#value#
 
    </select>
 
    
 
    <!-- 코멘트 리스트 조회 -->
 
    <select id="getCommentList" parameterClass="int" resultClass="commentVO">
 
        SELECT     no,
 
                board_no boardNo,
 
                id,
 
                writer,
 
                contents,
 
                regdate
 
        FROM board_comment
 
        WHERE board_no=#value#
 
        order by no
 
    </select>
 
    
 
    <!-- 코멘트 수정 -->
 
    <update id="updateComment" parameterClass="commentVO">
 
        UPDATE board_comment SET contents=#contents#
 
        WHERE no=#no#
 
    </update>
 
    
 
    <!-- 코멘트 삭제 -->
 
    <delete id="deleteComment" parameterClass="int">
 
        DELETE FROM board_comment
 
        WHERE no=#value#
 
    </delete>
 
</sqlMap>
 
 
 
 
cs


Posted by MR 손
,

Posted by MR 손
,

 

CREATE TABLE blog

(

    no NUMBER(11) NOT NULL,

    id VARCHAR2(30),

    img VARCHAR2(100),

    about VARCHAR2(2000),

    regdate DATE NOT NULL,

    CONSTRAINT "BLOG_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

CREATE TABLE blog_category

(

    no NUMBER(11) NOT NULL,

    blog_no NUMBER(11) NOT NULL,

    contents VARCHAR2(100),

    regdate DATE NOT NULL,

    CONSTRAINT "BLOG_CATEGORY_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

 

CREATE TABLE blog_board

(

    no NUMBER(11) NOT NULL,

    blog_category_no NUMBER(11) NOT NULL,

    title VARCHAR2(100),

    contents CLOB,

    hit NUMBER(11),

    regdate DATE NOT NULL,

    CONSTRAINT "BLOG_BOARD_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

 

CREATE TABLE product

(

    no NUMBER(11) NOT NULL,

    product_name VARCHAR2(100) NOT NULL,

    price NUMBER NOT NULL,

    production VARCHAR2(100),

    authentication VARCHAR2(100),

    shipping VARCHAR2(100),

    regdate DATE NOT NULL,

    CONSTRAINT "PRODUCT_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

 

CREATE TABLE product_image

(

    no NUMBER(11) NOT NULL,

    product_no NUMBER(11) NOT NULL,

    img VARCHAR2(100) NOT NULL,

    regdate DATE NOT NULL,

    CONSTRAINT "PRODUCT_IMAGE_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

 

CREATE TABLE membership

(

    no NUMBER(11) NOT NULL,

    id VARCHAR2(30) NOT NULL,

    name VARCHAR2(100) NOT NULL,

    password VARCHAR2(30) NOT NULL,

    phone VARCHAR2(20) NOT NULL,

    birthday DATE,

    nickname VARCHAR2(100),

    post CHAR(7 BYTE) NOT NULL,

    addr1 VARCHAR2(150),

    addr2 VARCHAR2(200),

    email VARCHAR2(50),

    regdate DATE NOT NULL,

    CONSTRAINT "MEMBERSHIP_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

CREATE TABLE reserve_state

(

    code VARCHAR2(4) NOT NULL,

    contents VARCHAR2(50),

    regdate DATE NOT NULL,

    CONSTRAINT "RESERVE_STATE_PK" PRIMARY KEY ("CODE") ENABLE

)

;

 

CREATE TABLE reserve

(

    no NUMBER(11) NOT NULL,

    reserve_state_code VARCHAR2(4) NOT NULL,

    product_no NUMBER(11) NOT NULL,

    count NUMBER(3) NOT NULL,

    item_price NUMBER(11),

    regdate DATE NOT NULL,

    CONSTRAINT "RESERVE_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

CREATE TABLE "BOARD"

(    "NO" NUMBER(11,0) NOT NULL ENABLE,

    "GROUP_NO" NUMBER(11,0) NOT NULL ENABLE,

    "ORDER_NO" NUMBER(11,0) NOT NULL ENABLE,

    "DEPTH_NO" NUMBER(11,0) NOT NULL ENABLE,

    "ID" VARCHAR2(30),

    "TITLE" VARCHAR2(100),

    "WRITER" VARCHAR2(50),

    "CONTENTS" CLOB,

    "HIT" NUMBER(11,0),

    "TYPE" VARCHAR2(50),

    "REGDATE" DATE NOT NULL ENABLE,

     CONSTRAINT "BOARD_PK" PRIMARY KEY ("NO") ENABLE

);

 

CREATE TABLE board_comment

(

    no NUMBER(11) NOT NULL,

    board_no NUMBER(11) NOT NULL,

    id VARCHAR2(30),

    writer VARCHAR2(50),

    contents VARCHAR2(2000),

    regdate DATE,

    CONSTRAINT "BOARD_COMMENT_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

CREATE TABLE blog_comment

(

    no NUMBER(11) NOT NULL,

    blog_board_no NUMBER(11) NOT NULL,

    writer VARCHAR2(50),

    contents VARCHAR2(2000),

    regdate DATE NOT NULL,

    CONSTRAINT "BLOG_COMMENT_PK" PRIMARY KEY ("NO") ENABLE

)

;

 

create sequence board_seq;

create sequence board_comment_seq;

create sequence member_seq;

Posted by MR 손
,