기본 콘텐츠로 건너뛰기

9월, 2013의 게시물 표시

[mysql] 명령어.

source:  http://makandracards.com/makandra/2529-show-and-change-mysql-default-character-set mysql> show columns from BOARD; +-----------+---------------+------+-----+---------+----------------+ | Field     | Type          | Null | Key | Default | Extra          | +-----------+---------------+------+-----+---------+----------------+ | articleId | int(10)       | NO   | PRI | NULL    | auto_increment | | username  | varchar(20)   | NO   |     | NULL    |                | | password  | char(4)       | NO   |     | NULL    |                | | title     | varchar(12)   | NO   |     | NULL    |                | | content   | varchar(3000) | YES  |     | NULL    |                | +-----------+---------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec) mysql > SHOW VARIABLES LIKE 'char%' ; +--------------------------+----------------------------+ | Variable_name | Value | +-------------------------

[DB] Mysql에서 사용자 추가부터 테이블 생성 및 레코드 삽입까지.

$> mysql -u root -p # login mysql>CREATE DATABASE freeboard; -- 디비 만들기 CREATE USER ' newuser '@'localhost' IDENTIFIED BY ' password '; -- 유져 추가하기 GRANT ALL PRIVILEGES ON freeboard.* TO ' newuser '@'localhost'; -- 유져에게 권한부여 FLUSH PRIVILEGES; -- 적용하기 mysql> CREATE TABLE BOARD(     ARTICLE_ID int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,     Username varchar(20) NOT NULL,     Password char(4) NOT NULL,     Title varchar(12) NOT NULL,     Content varchar(3000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- utf8용으로 테이블 만들기 INSERT INTO BOARD (username,password,title, content)  VALUES   ("jinsung","5555","Sam Forest!","You are the asset!"); -- 레코드 하나 넣어보기

[DB] 서브쿼리(Subquery)문 - select 안에 select 문

source:  http://gandus.tistory.com/147 밖에 있는 쿼리문은  메인 쿼리(Mainquery) 그것 외에는 서브쿼리(inner query라고도 한다 쿼리문을 시작할때는 서브쿼리 부터 실행한후 메인 쿼리를 실행한다. 스미스보다 월급이 많은 사람을 나타내어라. 메인쿼리문을 이용할때는 select sal from emp where ename = '스미스';    // 800원이라고 나오면 select ename, sal from emp where sal > 800; 이것을 이중쿼리로 이용하면 select sal, ename from emp where sal > (select sal from emp where ename='스미스'); 이렇게 한문장으로 가능하다.

[스프링 어노테이션] Creating Custom Annotations and Using Them

source:  http://isagoksu.com/2009/development/java/creating-custom-annotations-and-making-use-of-them/ Okay, here is another topic that I couldn’t find much information in the Internet :) So I guess I’m gonna cover it quickly. How to Create a Custom Annotations? There are a lot of documentation about this part in the Internet. All you have to do is basically creating an annotation class like below: public @ interface Copyright { String info () default "" ; } And that’s it. Now it’s ready to use! Now you can put copyright information to your classes :) Since we didn’t define any  @Target , you can use this annotation anywhere in your classes by default. If you want your annotation to be only available for class-wise or method-wise, you should define  @Target  annotation. Here is a little table of what options are available: @Target(ElementType.PACKAGE) , package header @Target(ElementType.TYPE) , class header @Target(ElementType.CONSTRUCTOR) , co