'프로그램 사용'에 해당되는 글 2190건

  1. 2014.05.20 oracle 타입 - nvarchar2 varchar2
  2. 2014.05.20 oracle view
  3. 2014.05.20 oracle alter
  4. 2014.05.19 struts2 result type input
  5. 2014.05.18 subclipse vs subversive?
  6. 2014.05.17 struts2 result type
  7. 2014.05.16 struts2 / tiles 연동시 에러
  8. 2014.05.15 tiles xml 설정(상속)
  9. 2014.05.14 struts2 .action 확장자 변경하기 2
  10. 2014.05.14 ibatis - db framework
프로그램 사용/oracle2014. 5. 20. 23:32
오라클에는 varchar2 라는 타입을 주로 사용하지만
이녀석은 char[] 로 1바이트 문자열을 최대 4000 byte까지 저장할 수 있다.
물론 4000 바이트라는건 최대 선언 가능한 길이일뿐
varcahr2 타입으로 선언한다고 해서 가변으로 0~4000자를 입력할수 있는건 아니다.
(이렇게 자동으로 길이 해주면 얼마나 좋았을까 -_-)

아무튼 요즘은 바야흐로(?) 유니코드 시대이기에 문자열 역시 유니코드로 저장하게 되는데
DB에서도 varchar2와 같이 1byte 문자열이 아닌 2byte 문자열(UTF-8 / UTF-16)을 지원해야 하고
이녀석은 nvarchar2로 N이 하나 더 붙게 된다.


VARCHAR2 and VARCHAR Datatypes

The VARCHAR2 datatype stores variable-length character strings. When you create a table with a VARCHAR2 column, you specify a maximum string length (in bytes or characters) between 1 and 4000 bytes for the VARCHAR2 column. For each row, Oracle stores each value in the column as a variable-length field unless a value exceeds the column's maximum length, in which case Oracle returns an error. Using VARCHAR2 and VARCHAR saves on space used by the table.

For example, assume you declare a column VARCHAR2 with a maximum size of 50 characters. In a single-byte character set, if only 10 characters are given for the VARCHAR2 column value in a particular row, the column in the row's row piece stores only the 10 characters (10 bytes), not 50.

Oracle compares VARCHAR2 values using nonpadded comparison semantics.


NCHAR and NVARCHAR2 Datatypes

NCHAR and NVARCHAR2 are Unicode datatypes that store Unicode character data. The character set of NCHAR and NVARCHAR2 datatypes can only be either AL16UTF16 or UTF8 and is specified at database creation time as the national character set. AL16UTF16 and UTF8 are both Unicode encoding.

The NCHAR datatype stores fixed-length character strings that correspond to the national character set.

The NVARCHAR2 datatype stores variable length character strings.

When you create a table with an NCHAR or NVARCHAR2 column, the maximum size specified is always in character length semantics. Character length semantics is the default and only length semantics for NCHAR or NVARCHAR2.

For example, if national character set is UTF8, then the following statement defines the maximum byte length of 90 bytes:

CREATE TABLE tab1 (col1 NCHAR(30));

This statement creates a column with maximum character length of 30. The maximum byte length is the multiple of the maximum character length and the maximum number of bytes in each character. 
[링크 : http://docs.oracle.com/cd/B19306_01/server.102/b14220/datatype.htm

If you prefer to implement Unicode support incrementally, or if you need to support multilingual data only in certain columns, then you can store Unicode data in either the UTF-16 or UTF-8 encoding form in SQL NCHAR datatypes (NCHAR, NVARCHAR2, and NCLOB). The SQL NCHAR datatypes are called Unicode datatypes because they are used only for storing Unicode data.

[링크 : http://docs.oracle.com/cd/B28359_01/server.111/b28298/ch6unicode.htm]

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

sql distinct  (0) 2014.05.29
oracle 대소문자 구분없이 검색하기  (0) 2014.05.28
oracle view  (0) 2014.05.20
oracle alter  (0) 2014.05.20
oracle sequence 명령어  (0) 2014.05.11
Posted by 구차니
프로그램 사용/oracle2014. 5. 20. 16:08
view는 일종의 select sql 문을 저장해 두는 기능을 한다.

CREATE VIEW locations_view AS
   SELECT d.department_id, d.department_name, l.location_id, l.city
   FROM departments d, locations l
   WHERE d.location_id = l.location_id;

SELECT column_name, updatable 
   FROM user_updatable_columns
   WHERE table_name = 'LOCATIONS_VIEW';
 
[링크 : http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_8004.htm

어떻게 보면.. 게시판 소스에서 많이 보게 되는 서브쿼리 혹은 중첩쿼리의 기능인데
subquery / inline view 라고도 부르며 이녀석 역시 일종의 view 인 것이었다!!

Inline 뷰
인라인 뷰는 FROM 절에서 서브쿼리를 사용하여 생성한 임시 뷰이다. 인라인 뷰는 SQL 문이 실행되는 동안만 임시적으로 정의된다.
 
[링크 : http://radiocom.kunsan.ac.kr/lecture/oracle/what_is/view.html

[링크 : http://zetswing.com/bbs/board.php?bo_table=ORACLE_TIP&wr_id=9&page=2


+
mysql에서 view는 5.0.x 부터 지원한다.
[링크 : http://dev.mysql.com/doc/refman/5.0/en/views.html]

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

oracle 대소문자 구분없이 검색하기  (0) 2014.05.28
oracle 타입 - nvarchar2 varchar2  (0) 2014.05.20
oracle alter  (0) 2014.05.20
oracle sequence 명령어  (0) 2014.05.11
오라클 DDL 정리  (0) 2014.05.11
Posted by 구차니
프로그램 사용/oracle2014. 5. 20. 15:43
변경시에는 추가된 값이 있으면 안되는 경우도 있으니(date -> varchar2)
주의해서 사용해야 할 듯...

alter table tablename add (colname type ..) // 항목 추가하기
alter table tablename drop column // 항목 삭제하기
alter table tablename modify (colname newtype ..) // 변수형 바꾸기
alter table tablename rename column oldname to newname // 항목명 바꾸기(9iR2 이후) 

[링크 : http://majesty76.tistory.com/27]


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

oracle 타입 - nvarchar2 varchar2  (0) 2014.05.20
oracle view  (0) 2014.05.20
oracle sequence 명령어  (0) 2014.05.11
오라클 DDL 정리  (0) 2014.05.11
오라클 10g용 시작/종료 스크립트  (0) 2014.04.11
Posted by 구차니

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

스트럿츠 동적 레이아웃 구성하기  (0) 2014.05.22
struts2 action에 파라미터 넘기기  (0) 2014.05.22
struts2 result type  (0) 2014.05.17
struts2 / tiles 연동시 에러  (0) 2014.05.16
tiles xml 설정(상속)  (0) 2014.05.15
Posted by 구차니
프로그램 사용/eclipse2014. 5. 18. 18:55
sublclipse와 subversive는 별반 차이가 없어 보이나..
내부적으로 많이 다른것 같은 느낌...?


일단 subversive는 subclipse에서 JavaHL을 통해 Native하게 C언어를 끌어와서 하는것 같고
그 기반으로 JavaHL(High Language) / JNA(Java Native Access)를 이용하는 것으로 생각된다.

음.. subclipse와 subversive의 외관상의 차이는...
subversive 에는 단축키가 할당되고
subclipse 에는 단축키가 없다는 것과

checkout 시에 미묘한 차이가 있다는 것 정도?

subclipse의 단축키가 없는 모습


subversive의 단축키 모습. 그리고 아이콘도 촘촘히 존재한다.


아무트 설치과정은
Subversive 설치 후


리부팅시에 맞는 버전에 따라 (귀찮으니 그냥 JavaHL 32bit/64bit로 하면 됨) 설치한다.


[링크 : http://subclipse.tigris.org/wiki/JavaHL] JavaHL
[링크 : http://en.wikipedia.org/wiki/Java_Native_Access] JNA
[링크 : http://www.eclipseonetips.com/.../eclipse-shortcuts-for-common-svn-commands/]  이클립스 단축키 설정
[링크 : http://www.eclipse.org/subversive/index.php] subvesive
[링크 : http://stackoverflow.com/questions/553133/subclipse-with-svnkit-adapter ] SVNKit Connector
Posted by 구차니
오오.. 통합의 위력 ㄷㄷ
스트럿츠 2의 결과를 돌려주는 방식은 다음과 같다.

Chain Result Used for Action Chaining
Dispatcher Result Used for web resource integration, including JSP integration
FreeMarker Result Used for FreeMarker integration
HttpHeader Result Used to control special HTTP behaviors
Redirect Result Used to redirect to another URL (web resource)
Redirect Action Result Used to redirect to another action mapping
Stream Result Used to stream an InputStream back to the browser (usually for file downloads)
Velocity Result Used for Velocity integration
XSL Result Used for XML/XSLT integration
PlainText Result Used to display the raw content of a particular page (i.e jsp, HTML)
Tiles Result Used to provide Tiles integration

다른건 모르겟고.. chain의 경우 로그인과 같이 여러개 페이지를 돌릴때 묶어서(chain)
쓴다고 하는데 조금 더 찾아 봐야 할 듯..

[링크 : http://struts.apache.org/release/2.2.x/docs/result-types.html]
[링크 : http://struts.apache.org/release/2.2.x/docs/tiles-plugin.html]
    [링크 : http://struts.apache.org/release/2.2.x/docs/action-chaining.html]


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

struts2 action에 파라미터 넘기기  (0) 2014.05.22
struts2 result type input  (0) 2014.05.19
struts2 / tiles 연동시 에러  (0) 2014.05.16
tiles xml 설정(상속)  (0) 2014.05.15
struts2 .action 확장자 변경하기  (2) 2014.05.14
Posted by 구차니
스트럿츠2에 타일스를 연동하려는데 계속 에러가 나서 멘붕 -_-
XML 상으로는 문제가 없지만 action 이나 success에 연결되는 놈이 없다고 난리핀다 -_-
심각: Exception starting filter struts2
Error building results for action indexAction in namespace  - action - file:/D:/monk/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2_board/WEB-INF/classes/struts.xml:8:56

Caused by: There is no result type defined for type 'tiles' mapped with name 'success' - result - file:/D:/monk/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2_board/WEB-INF/classes/struts.xml:9:25 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<package name="board" extends="struts-default, tiles-default">
<action name="indexAction" class="board.indexAction">
<result type="tiles">home</result>
</action>
</package>
</struts>


스트럿츠2+타일스 통합글을 보다보니 헐...
ㅋㅋㅋㅋ
ㅋㅋㅋㅋ

struts2-core-2.0.14.jar
struts2-tiles-plugin-2.0.8.jar <<<

스트럿츠2-타일스 연동을 위해서는 플러그 인 이 추가되어야 하는데
해당 jar 파일을 넣지 않았으니.. 될리가 있나 -_-a

[링크 : http://thinkingblog.tistory.com/19

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

struts2 result type input  (0) 2014.05.19
struts2 result type  (0) 2014.05.17
tiles xml 설정(상속)  (0) 2014.05.15
struts2 .action 확장자 변경하기  (2) 2014.05.14
strtus2 레퍼런스  (0) 2014.04.30
Posted by 구차니
extends를 이용해서 끌어오면 된다.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>

    <!-- Default Main Template -->
    <definition name=".mainTemplate" template="/WEB-INF/templates/main.jsp">
        <put-attribute name="title" value="Simple Tiles 2 Example" type="string" />
        <put-attribute name="header" value="/WEB-INF/templates/header.jsp" />
        <put-attribute name="footer" value="/WEB-INF/templates/footer.jsp" />
        <put-attribute name="menu" value="/WEB-INF/templates/menu.jsp" />
        <put-attribute name="body" value="/WEB-INF/templates/blank.jsp" />
    </definition>
 
    <definition name="index" extends=".mainTemplate">
        <put-attribute name="body" value="/WEB-INF/jsp/index.jsp" />
    </definition>

    <definition name="info/about" extends=".mainTemplate">
        <put-attribute name="body" value="/WEB-INF/jsp/info/about.jsp" />
    </definition>
    
</tiles-definitions>

[링크 : http://www.springbyexample.org/examples/simple-tiles-spring-mvc-webapp-tiles-xml-config.html

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

struts2 result type input  (0) 2014.05.19
struts2 result type  (0) 2014.05.17
struts2 / tiles 연동시 에러  (0) 2014.05.16
struts2 .action 확장자 변경하기  (2) 2014.05.14
strtus2 레퍼런스  (0) 2014.04.30
Posted by 구차니
기본 설정에서 action으로 되어 있는 것 같은데..
아무튼, 이렇게 constant 설정을 통해서 변경이 가능하다.

걍.. do로 해볼까?

<struts>
    <constant name="struts.action.extension" value="html"/> 
</struts>

[http://www.mkyong.com/struts2/how-to-remove-the-action-suffix-extension-in-struts-2/

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

struts2 result type input  (0) 2014.05.19
struts2 result type  (0) 2014.05.17
struts2 / tiles 연동시 에러  (0) 2014.05.16
tiles xml 설정(상속)  (0) 2014.05.15
strtus2 레퍼런스  (0) 2014.04.30
Posted by 구차니
ibatis는 현재 mybatis로 이름이 변경되었다.

db를 위한 프레임워크로
코드상에 sql문을 넣는게 아닌 xml에 sql문을 넣어 관리가 용이하도록 한다.

[링크 : https://ibatis.apache.org/]
[링크 : http://blog.mybatis.org/]
  [링크 : http://mybatis.github.io/mybatis] 문서
Posted by 구차니