Programming/jsp2014. 4. 2. 16:48
JSP의 connection pool은 대규모 접속을 원활하게 하기 위해
미리 만들어 놓은 소켓을 이용하여 재사용하는 식으로
소켓 생성/파괴의 오버로드를 줄이기 위한 라이브러리이다.

apache의 common 프로젝트로 관리되고 있다.

[링크 : http://commons.apache.org/proper/commons-pool/download_pool.cgi] commons-pool.jar
[링크 : http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi] commons-dbcp.jar

[링크 : http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html]
[링크 : https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

'Programming > jsp' 카테고리의 다른 글

eclipse에서 tomcat 서버 추가가 되지 않을 경우  (0) 2014.04.06
oracle sql / sequence  (0) 2014.04.04
jsp jdbc 기본 코드  (0) 2014.04.01
jdbc URL 구조  (0) 2014.04.01
jsp action tag / <jsp:useBean  (0) 2014.03.31
Posted by 구차니

으앙 집에서 해보니 갑자기 안뜨는 상황발생!


Window - Preference - Java - Installed JREs - Edit


rt.jar - Javadoc Location


javadoc location에 http://docs.oracle.com/javase/7/docs/api/를 추가!
물론 다운로드 받은 javadoc의 경로를 Javadoc in archive를 통해 설정해주어도 된다.
(개인적으로는 다운받아서 하는걸 추천.. 자바 사이트 은근히 느리니까..) 


이제 제대로 뜬다!! 두둥!


[링크 : http://www.androidstudy.co.kr/bbs/board.php?bo_table=C09&wr_id=74]


+ 2014.04.03 추가
JDK1.7은 기본으로 설정되어 있으나 JDK1.8 배포판의 문제인지 1.8에서는 javadoc이 생략되어 있다.
JDK1.7역시 http://docs.oracle.com/javase/7/docs/api/ 으로 설정되어 있다.

'프로그램 사용 > eclipse' 카테고리의 다른 글

google code + subclipse(eclipse / SVN)  (0) 2014.05.01
eclipse JSP / SQL 지원관련  (0) 2014.04.23
eclipse + quantumDB plugin + jdbc driver  (0) 2014.04.01
ECJ - Eclipse Compiler for Java  (0) 2014.03.25
eclipse JRE 설정하기  (0) 2014.03.20
Posted by 구차니
Programming/jsp2014. 4. 1. 22:15
걍 외우는게 속편할(?) 녀석 ㅠㅠ

<%@ page import = "java.sql.DriverManager" %>
<%@ page import = "java.sql.SQLException" %>
<%@ page import = "java.sql.Connection" %> // interface
<%@ page import = "java.sql.Statement" %> // interface
<%@ page import = "java.sql.ResultSet" %> // interface

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection conn = null;
Statement stmt = null;
ResultSet rs = null;

conn = DriverManager.getConnection(jdbcDriver, dbUser, dbPass);
stmt = conn.createStatement();
rs = stmt.executeQuery(query);

rs.next();
rs.getString("FIELD_NAME"); 


'Programming > jsp' 카테고리의 다른 글

oracle sql / sequence  (0) 2014.04.04
jsp / tomcat connection pool  (0) 2014.04.02
jdbc URL 구조  (0) 2014.04.01
jsp action tag / <jsp:useBean  (0) 2014.03.31
jsp cookie  (0) 2014.03.31
Posted by 구차니
Programming/jsp2014. 4. 1. 18:32
"jdbc:oracle:thin:@myhost:1521:orcl"

jdbc를 통해 (java)
oracle db에 (database server type)
thin driver를 통해
myhost 라는 서버에
1521 번 포트로
orcl 데이터베이스에 접속(database name)



Understanding the Forms of getConnection()

Specifying a Databse URL, User Name, and Password

The following signature takes the URL, user name, and password as separate parameters:

getConnection(String URL, String user, String password);

Where the URL is of the form:
  jdbc:oracle:<drivertype>:@<database>

The following example connects user scott with password tiger to a database with SID orcl through port 1521 of host myhost, using the Thin driver.

Connection conn = DriverManager.getConnection
  ("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "tiger");

------------
Oralce provides four types of JDBC driver.

Thin Driver, a 100% Java driver for client-side use without an Oracle installation, particularly with applets. The Thin driver type is thin. To connect user scott with password tiger to a database with SID (system identifier) orcl through port 1521 of host myhost, using the Thin driver, you would write :
  Connection conn = DriverManager.getConnection
  ("jdbc:oracle:thin:@myhost:1521:orcl", "scott", "tiger");
  
OCI Driver for client-side use with an Oracle client installation. The OCI driver type is oci. To connect user scott with password tiger to a database with SID (system identifier) orcl through port 1521 of host myhost, using the OCI driver, you would write :
  Connection conn = DriverManager.getConnection
  ("jdbc:oracle:oci:@myhost:1521:orcl", "scott", "tiger");
  
Server-Side Thin Driver, which is functionally the same as the client-side Thin driver, but is for code that runs inside an Oracle server and needs to access a remote server, including middle-tier scenarios. The Server-Side Thin driver type is thin and there is no difference in your code between using the Thin driver from a client application or from inside a server.
 
Server-Side Internal Driver for code that runs inside the target server, that is, inside the Oracle server that it must access. The Server-Side Internal driver type is kprb and it actually runs within a default session. You are already "connected". Therefore the connection should never be closed.
To access the default connection, write:
  DriverManager.getConnection("jdbc:oracle:kprb:");
  or:
  DriverManager.getConnection("jdbc:default:connection:");

[링크 : http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/jdbc/OracleDriver.html

'Programming > jsp' 카테고리의 다른 글

jsp / tomcat connection pool  (0) 2014.04.02
jsp jdbc 기본 코드  (0) 2014.04.01
jsp action tag / <jsp:useBean  (0) 2014.03.31
jsp cookie  (0) 2014.03.31
jsp 액션 태그 - <jsp:  (0) 2014.03.28
Posted by 구차니
quantumDB는 아직 eclipse 마켓 플레이스에는 지원하지 않는다 -_-a
결국은 걍 다운받아서 설치해야 한다는 것!!




[링크 : http://quantum.sourceforge.net/]
    [링크 : http://sourceforge.net/projects/quantum/files/quantum-plugin/]


jdbc driver (oracle 계정필수)
[링크 : http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-10201-088211.html] 10g
[링크 : http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-111060-084321.html] 11g
Posted by 구차니
grant는 사용자 권한을 부여해주는 명령어이다.
이거 쓰기 힘들어서 맨날 myphpadmin 쓰니 ^^;;;;;

 grant [권한목록] on [dbname] to [account]@[server] identified by [password]

GRANT
    priv_type [(column_list)]
      [, priv_type [(column_list)]] ...
    ON [object_type] priv_level
    TO user_specification [, user_specification] ...
    [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]
    [WITH with_option ...]

object_type:
    TABLE
  | FUNCTION
  | PROCEDURE

priv_level:
    *
  | *.*
  | db_name.*
  | db_name.tbl_name
  | tbl_name
  | db_name.routine_name

user_specification:
    user [IDENTIFIED BY [PASSWORD] 'password']

ssl_option:
    SSL
  | X509
  | CIPHER 'cipher'
  | ISSUER 'issuer'
  | SUBJECT 'subject'

with_option:
    GRANT OPTION
  | MAX_QUERIES_PER_HOUR count
  | MAX_UPDATES_PER_HOUR count
  | MAX_CONNECTIONS_PER_HOUR count
  | MAX_USER_CONNECTIONS count

[링크 : http://dev.mysql.com/doc/refman/5.1/en/grant.html

'프로그램 사용 > mysql & mariaDB' 카테고리의 다른 글

mysql / mariaDB  (1) 2014.04.16
mysql transaction  (0) 2014.04.08
mysql 암호변경하기  (0) 2013.02.21
mysql 명령어 정리  (0) 2012.12.01
mysql 사용법(SQL)  (4) 2010.04.03
Posted by 구차니
프로그램 사용/meld2014. 3. 31. 23:57
로케일 문제로 생각 되는데..

[링크 : https://code.google.com/p/meld-installer/issues/detail?id=42]



환경설정의 폰트는 영향을 주지 않았고


커맨드 라인에서 

C:\> set LANG=EN_US
C:\> cd C:\Program Files (x86)\Meld\meld
C:\Program Files (x86)\Meld\meld> meld 
하니 문제없이 내용이 잘 나온다.


'프로그램 사용 > meld' 카테고리의 다른 글

meld 자동 줄 바꿈  (0) 2024.07.19
meld for windows  (0) 2014.03.31
meld 에서 문법강조 켜기(syntax highlighter on Meld)  (0) 2011.10.15
meld - GUI merge tool for linux  (0) 2009.04.06
GUI diff tool - meld  (6) 2009.02.13
Posted by 구차니
프로그램 사용/meld2014. 3. 31. 22:07
google code에서 하다가 sourceforge로 옮겨진 듯

meld는 아쉽게도 winmerge 처럼
파일이 아닌 ctrl-c,v로 즉석에 비교할 수는 없다.


Blank comparison 을 누른후


Files are identical 이라는 곳 아래에 커서쪽에 붙여 넣으면 비교가 가능하다!!


[링크 : http://sourceforge.net/projects/meld-installer/]
Posted by 구차니
Programming/jsp2014. 3. 31. 20:49
자바빈에 대한 전반적인건 아니고.. 
jsp 액션 태그로서의
jsp:useBean은 사용법이 간단한 편이다.

DTO(Data Transfer Object) 라고도 표현하며
form의 변수명과 bean에 접속할 클래스의 변수명이 동일할 경우 

을 통해 변수 수 만큼 불러오고 지정하는 수고를 덜 수 있는 장점이 있다.
<jsp:getProperty name="beanName" property="*"/> 

물론 class 파일에서는 변수명과 동일한
public void setVarname(vartype varname)
public vartype getVarname() 
두개의 쌍으로 이루어진 수 많은 함수들을 생성해야 하는 단점이 존재한다. 



'Programming > jsp' 카테고리의 다른 글

jsp jdbc 기본 코드  (0) 2014.04.01
jdbc URL 구조  (0) 2014.04.01
jsp cookie  (0) 2014.03.31
jsp 액션 태그 - <jsp:  (0) 2014.03.28
jsp error 페이지 사이즈 제한(IE)  (0) 2014.03.27
Posted by 구차니
Programming/jsp2014. 3. 31. 20:48
쿠키는 로그인 정보나 장바구니 등에 사용되는
데이터를 클라이언트에 저장하는 기술이다.

[링크 : http://en.wikipedia.org/wiki/HTTP_cookie]

기본적으로 쿠키는 보안에 취약한 단점이 있어 주의해서 사용해야 하며
이를 보완하기 위해 도메인과 경로를 이용하여 접근을 막는 방법이 존재한다.
하지만 클라이언트 쿠키 저장소에 직접 접근을 막을수는 없으니 이래저래 보안이 취약하긴 매한가지.
void setDomain(String domain)
Specifies the domain within which this cookie should be presented.

void setPath(String uri)
Specifies a path for the cookie to which the client should return the cookie. 

jsp에서는 Cookie 클래스를 통해 쿠키를 생성하며
클라이언트에 저장된 쿠키를 서버에서 접근이 가능해지는 구조이다.

쿠키는 한글입력 불가하나 일일이 인코딩해서 사용하면 가능하다.
URLEncoder.encode("한글","euc-kr")
URLDecoder.decode(cookie.getValue(), "euc-kr") 
 
 
쿠키는 보안을 위해 유효시간을 지니며
setMaxAge를 통해 파기 할때 까지의 시간을 초 단위로 지정할 수 있다.
0으로 설정시에는 0초후 파기되므로, 쿠키를 파기하는데 주로 사용된다.
setMaxAge
public void setMaxAge(int expiry)
Sets the maximum age in seconds for this Cookie.
A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.

A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.

Parameters:
expiry - an integer specifying the maximum age of the cookie in seconds; if negative, means the cookie is not stored; if zero, deletes the cookie


+ 2014.04.02 추가
setPath() 메소드는 절대경로로 먹는 느낌
webContent가 존재하는 최상위 경로로 부터 전체 경로를 적어야 한다.
그게.. "쿠키의 경로는 쿠키를 설정하는 서브릿을 포함해야 한다"의 의미이려나?
게다가 이클립스의 경우 프로젝트 명으로 폴더를 하나더 들어가기에
/프로젝트명/폴더 식으로 점점 더 길어진다. -_-a
request.getContextPath() 를 추가해주는게 좋을지도..

setPath

public void setPath(java.lang.String uri)
Specifies a path for the cookie to which the client should return the cookie.

The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog.

Consult RFC 2109 (available on the Internet) for more information on setting path names for cookies.

Parameters:
uri - a String specifying a path
See Also:
getPath() 

'Programming > jsp' 카테고리의 다른 글

jdbc URL 구조  (0) 2014.04.01
jsp action tag / <jsp:useBean  (0) 2014.03.31
jsp 액션 태그 - <jsp:  (0) 2014.03.28
jsp error 페이지 사이즈 제한(IE)  (0) 2014.03.27
jsp buffer  (0) 2014.03.27
Posted by 구차니