*******  Intro11.jsp   *******
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<form>
행 : <input type="text" name="rows"><p/>
열 : <input type="text" name="cols"><p/>
<input type="submit" value="확인"><p/>
</form>
<%
int rows =1, cols=1;
//만약 폼변수 rows과 cols가 null이 아니라면.
if(request.getParameter("rows") != null && request.getParameter("cols") != null)
{
 if(request.getParameter("rows") != "" && request.getParameter("cols") != "")
 {
  rows=(new Integer(request.getParameter("rows")).intValue());
  cols=Integer.parseInt(request.getParameter("cols"));
 }
}
%>
<table border="1" width="640">
<%
//반복할것 (1부터 rows까지)
for(int i=1;i<rows+1;i++)
{
 %>
 <tr>
 <%
 //반복할것 (1부터 cols까지)
 for(int j=1;j<cols+1;j++)
 {
 %>
  <td><%= i %>X<%= j %>=<%= i*j %></td>
 <%
 }
 %>
 </tr>
<%
}
%>
</table>

</body>
</html>



************    Intro17.jsp      *****************
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<form method="post" action="Intro17pro.jsp">
행 : <input type="text" name="rows"><p/>
열 : <input type="text" name="cols"><p/>
<input type="submit" value="다음">
</form>
</body>
</html>

********   Intro17pro.jsp    **********
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.net.URLEncoder"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<% request.setCharacterEncoding("euc-kr"); %>
입력한 정보는 아래와 같습니다.
<% String params = "?rows="+ URLEncoder.encode(request.getParameter("rows"))+"&cols="+URLEncoder.encode(request.getParameter("cols")); %>
<form method="post" action="Intro11.jsp">
행 : <%=request.getParameter("rows") %><p>
열 : <%=request.getParameter("cols") %><p>
<input type="hidden" name="rows" value="<%=request.getParameter("rows") %>">
<input type="hidden" name="cols" value="<%=request.getParameter("cols") %>">
<input type="submit" value="다음"><p>
<!--<input type="button" value="location으로 자료전송" OnClick="location='Intro11.jsp?rows=<%= URLEncoder.encode(request.getParameter("rows"))%>&cols=<%= URLEncoder.encode(request.getParameter("cols"))%>';">
<input type="button" value="팝업" onClick="open('Intro11.jsp?rows=<%= URLEncoder.encode(request.getParameter("rows"))%>&cols=<%= URLEncoder.encode(request.getParameter("cols"))%>','intro11','width=640,height=480')">
-->
<input type="button" value="location으로 자료전송" OnClick="location='Intro11.jsp<%= params%>';">
<input type="button" value="팝업" onClick="open('Intro11.jsp<%= params%>','intro11','width=640,height=480')">
</form>
</body>
</html>

Posted by 말없제이
,

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!-- Intro15.jsp -->   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<form action="Intro15pro.jsp" method="post">
id:<input type="text" name="id"><p>
이름:<input type="text" name="name"><p>
Email:<input type="text" name="email">
<input type="submit" value="Ok">
</form>
</body>
</html>


**********   Intro15pro.jsp    **********
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page import="java.net.*" %>   
<!-- Intro15pro.jsp -->   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<% request.setCharacterEncoding("euc-kr"); %>
Intro15pro의 출력내용.
<form method="post" action="Intro16.jsp">
id:<%=request.getParameter("id") %><p/>
name:<%=request.getParameter("name") %><p/>
email:<%=request.getParameter("email") %><p/>
<!--
만일 중간에 경유하는 웹페이지가 지금처럼 폼을 사용하는 경우라면
값의 전달을 아래와 같이 히든을 두어 지속적으로 넘겨줄 수 있다.
-->
<input type="hidden" name="id" value="<%=request.getParameter("id") %>">
<input type="hidden" name="name" value="<%=request.getParameter("name") %>">
<input type="hidden" name="email" value="<%=request.getParameter("email") %>">
<input type="submit" value="확인">
</form>
</body>
</html>


**********  Intro16.jsp   **********
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<% request.setCharacterEncoding("euc-kr"); %>

당신이 입력한 값은 다음과 같습니다.<p/>
id:<%=request.getParameter("id") %><p>
name:<%=request.getParameter("name") %><p>
email:<%=request.getParameter("email") %><p>
</body>
</html>

Posted by 말없제이
,

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!-- Intro13.jsp -->   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<form action="Intro13pro.jsp" method="get">
id:<input type="text" name="id"><p>
이름:<input type="text" name="name"><p>
Email:<input type="text" name="email">
<input type="submit" value="Ok">
</form>
</body>
</html>

***********  Intro13pro.jsp  ********
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page import="java.net.*" %>   
<!-- Intro13pro.jsp -->   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<% request.setCharacterEncoding("euc-kr"); %>
id:<%=request.getParameter("id") %><p>
name:<%=request.getParameter("name") %><p>
email:<%=request.getParameter("email") %><p>
<!--
request영역은 휘발성입니다...
고로 해당영역이 끝나면 소멸된다...
따라서 휘발성인 폼변수의 값을 다음페이지에 넘겨주려면
하이퍼링크의 경우 자료의 전송기능이 없으므로
아래와 같이 폼변수를 Get방식으로 만들어 계속적으로 전달해야
사용이 가능하다...
 -->
 <%
 //폼을 경유하지 않는 Get방식의 자료전송의 경우
 //반드시 java.net.URLEncoder.encode(인코딩할 변수,"문자셋")
 //으로 변수를 Encoding하여야 한다...
 String id
 =URLEncoder.encode(request.getParameter("id"),"euc-kr");
 String name
 =URLEncoder.encode(request.getParameter("name"),"euc-kr");
 String email
 =URLEncoder.encode(request.getParameter("email"),"euc-kr");
 %>
<a href="Intro14.jsp?id=<%=id %>&name=<%=name %>&email=<%=email %>">Intro14.jsp</a>
<p><a href="#" OnClick="open('Intro14.jsp?id=<%=id %>&name=<%=name %>&email=<%=email %>','intro14','width=320,height=200')">Popup</a>

</body>
</html>

**********  Intro14.jsp   *********
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<% request.setCharacterEncoding("euc-kr"); %>
Intro14<p/>

id : <%= request.getParameter("id") %><p/>
name : <%= request.getParameter("name") %><p/>
email : <%= request.getParameter("email") %><p/>
<a href="Intro13.jsp">Intro13.jsp</a>
</body>
</html>

Posted by 말없제이
,

*.비교연산자II(%,_)
LIKE A ~~~ : 애매모호한 범위 나타냄.. A 머시기~~~
% : 0개이상의 자릿수
_ : 1개 자릿수.
escape '~' : ~문자뒤에 있는 %,_은 %,_가 아니라 단순히 문자라는 표시.

ex) %
select * from emp
where ename like 'A%'

select * from emp
where ename like '%N'

*.입력
insert into 테이블명[(컬럼명, 컬럼명,..)]
values(값, 값,..)
ex)
 insert into emp(empno, ename)
 values(8000,'세바스%찬')
ex)
 insert into emp(empno, ename)
 values(8100,'마이_콜')

위내용 검색시... %, _로 검색시.
escape 사용
ex) 세바스%찬 찾기.
select *
from emp
where ename like '%#%%' escape '#'
ex) 마이_콜 찾기..
select * from emp where ename like '%@_%' escape '@'

*.삭제
delete [from] 테이블명 [where 조건]
ex) %들어간것 삭제
delete from emp
where ename like '%#%%' escape '#'

*.함수(function)
- 함수명(~~)
 .max/min : 해당열의 최대/최소값
 .sum/avg : 해당열의 총합/평균값
 .count : 행의 갯수카운트.
 .stddev
ex)
 select max(sal), min(sal), sum(sal), avg(sal)
 from emp
ex) -- 소문에 듣는 count(*), count(컬럼명) 차이,
-- *은 컬럼검색없이 rows계산, 컬럼명은 컬럼명검색후 계산
 select count(*), count(sal)
 from emp
- 그룹함수
 select ~
 from 테이블명
 group by 그룹기준
 

Posted by 말없제이
,
사용자 삽입 이미지

네이버 검색 - -;
Posted by 말없제이
,
개체와 클래스 기초개념 ppt
Posted by 말없제이
,
패티지 탐색에서 오른쪽마우스 > 내보내기
사용자 삽입 이미지
내보내기 하면 원래는 --.. WAR Export가 보여야 하는데..
안보이면.. 기타 > Web > WAR file
사용자 삽입 이미지
설치된 Tomcat폴더 \ webapps 경로가 실위치..
실제경로 예시)
사용자 삽입 이미지

목적지에는 tomcat이 실제 위치된 곳으로.
사용자 삽입 이미지
Posted by 말없제이
,
받아서 설치한 apach9-tomca 위치의 startup.bat 실행..
사용자 삽입 이미지
만약 실행시 아래와같이 애러가 난다면.. 경로가 안되어있는상태..
사용자 삽입 이미지
경로설정.
설정 > 제어판 > 시스템
사용자 삽입 이미지
고급 > 시스템 변수 > 새로만들기.
사용자 삽입 이미지

새 시스템 변수에다..
변수이름 : JAVA_HOME
변수 값 : JDK설치된 경로 설정.
사용자 삽입 이미지

정상시화면. 닫히지 않고 계속 유지됨.
eclipse 실행한상태에서 tomcat실행하면 에러난뒤 닫힘
즉. 닫고 실행하면 정상으로 뜸.
사용자 삽입 이미지
Posted by 말없제이
,
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%!
//%!영역은 선언문영역 : JSP가 서블릿으로 변환될때
//여기에 기술한 코딩은 자연스럽게 doService멤버변수밖으로
//영역에 기술된다.
//따라서 멤버변수의 선언 및 멤버함수의 정의를 둘 수 있다.
private String m;
public String sayHello()
{
 return m;
}
%>
<%
//서블릿은 jspService함수내에 들어가서
//실행문 영역 : % 와 % 사이의 구간
//%와 %사이의 구간은 서블릿으로 JSP로 변환될때
//doService멤버함수안의 영역으로 변환되며
//당연히 접근제어자나 함수의 정의를 쓰지 못한다.
this.m = "Hello";
out.print(this.sayHello());
%>
</body>
</html>
Posted by 말없제이
,

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<form>
행 : <input type="text" name="rows"></p>
열 : <input type="text" name="cols"></p>
<input type="submit" value="확인"></p>
</form>
<%
int rows =1, cols=1;
//만약 폼변수 rows과 cols가 null이 아니라면.
if(request.getParameter("rows") != null && request.getParameter("cols") != null)
{
 if(request.getParameter("rows") != "" && request.getParameter("cols") != "")
 {
  rows=(new Integer(request.getParameter("rows")).intValue());
  cols=Integer.parseInt(request.getParameter("cols"));
 }
}
%>
<table border="1" width="640">
<%
//반복할것 (1부터 rows까지)
for(int i=1;i<rows+1;i++)
{
 %>
 <tr>
 <%
 //반복할것 (1부터 cols까지)
 for(int j=1;j<cols+1;j++)
 {
 %>
  <td><%= i %>X<%= j %>=<%= i*j %></td>
 <%
 }
 %>
 </tr>
<%
}
%>
</table>

</body>
</html>

Posted by 말없제이
,