Tag Cloud

Blogumulus by Roy Tanck and Amanda Fazani

Adding background or header image to blogger or blogspot is easy.
Just follow the following steps.

  1. You can upload the image file to free host site like http://photobucket.com/
  2. Get the Direct Link of uploaded image to add
  3. Log in to Blogger
  4. Go to Template then Edit HTML
  5. Insert or Change image link URL wherever you want to add

in my case

#header-inner {border:1px solid #5d5d5e; background-position:center; margin:15px auto 0; background-image: url("http://i768.photobucket.com/albums/xx325/doyoung777/1.jpg"); background-position: left; width: 939px; min-height: 421px;_ height: 421px; background-repeat: no-repeat;}

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSet;
import java.util.Date;
import java.text.SimpleDateFormat;

public class compareTime
{
public static void main(String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver loading success");
}
catch (ClassNotFoundException e)
{
System.out.println("Driver loading fail");
}

try
{
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@IP:PORT:SID","ID","PASSWORD");
System.out.println("Connection Success");
System.out.println("");

Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select to_char(systimestamp, 'hh24:mi:ss:ff3') as time from dual");

System.out.println(getTime());

if (rs.next())
{
System.out.println("DB1 Time --> " + rs.getString("time"));
}

System.out.println(getTime());

conn.close();
System.out.println("");
System.out.println("Connection finished");
}
catch (SQLException sqle)
{
System.out.println("Connection fail");
}
catch (IllegalArgumentException ille)
{
System.out.println("IllegalArgument input");
}
}


private static String getTime()
{
SimpleDateFormat sdf = new SimpleDateFormat("kk:mm:ss:SS");

return "WAS1 Time --> " + sdf.format(new Date());
}
}

I just got to know today that you can change the color themes of your MS Office 2007.
There are 3 color themes.

  • Blue (default)

  • Black

  • Silver

Here's how you do it.
  • Open up any Office 2007 application.
  • Click on the Office Button.

  • Click on the option button. The option box will be open.


  • Click on the Popular tab(기본설정) and you'll see the color scheme selector.
  • Change your color scheme for Office 2007 and then click OK.
  • The selected color will be applied to Office 2007 (word, excel, powerpoint, outlook).

1. sqlplus login

- sqlplus /nolog

conn /as sysdba
alter user hr identified by hr account unlock (sysdba) e
conn scott (default user : scott / tiger)
- disconn

2. Data Dictionary

desc table_name -> Column, Nullable, Type, Commnet

SELECT * FROM Tab -> 존재하는 테이블 확인
SELECT * FROM USER_TABLES -> 각 테이블 정보 상세하게 확인
COMMENT ON [TABLE/COLUMN] [table_name / table_name.column_name] IS '주석 내용'
- data dictionary
-comments 확인SELECT * FROM USER_TAB_COMMENTSSELECT * FROM USER_COL_COMMENTS


3. 연산
= 같다< > or != 같지 않다IS NULL IS NOT NULL

4. dual table
함수 값 사용 sysdate 또는 입력값 표시
SELECT sysdate FROM dual

5. CONCATENATION
SELECT ENAME " " JOB "ENAME JOB" FROM EMP;

=============================================

복원 지점 COMMIT복원 ROLLBACK
============= 여러 건 insert ================

INSERT INTO EMP (ENPNO, ENAME, JOB, MGR)SELECT 9000+rownum, ENAME, JOB, MGR FROM EMP;
================= ORDER BY ==================

default ASC (오름차순)DESC (내림차순)
ORDER BY Column_name DESC

=============================================

SELECT DEPTNOFROM DEPTWHERE EXISTS (SELECT 'X' FROM EMP WHERE DEPT.DEPTNO = EMP.DEPTNO)
-->
SELECT DEPTNO FROM DEPTWHERE DEPTNO IN (SELECT DEPTNO FROM EMP)

=============================================

subquery SELECT, FROM, WHERE 절에 모두 사용가능
================ JOIN =======================

- INNER JOIN (여러 테이블의 key 값이 일치하는 행에 대해서만 적용)SELECT [column] FROM [table 1] INNER JOIN [table 2] ON [JOIN CONDITION 1] AND [JOIN CONDITION 2]
부서위치가 DALLAS인 모든 사원의 이름, 부서번호를 출력.
SELECT e.ENAME, d.DEPTNO, d.LOC FROM EMP e INNER JOIN DEPT d ON e.DEPTNO = d.DEPTNO WHERE d.LOC = 'DALLAS'
- [LEFT/RIGHT] OUTER JOIN (LEFT/RIGHT 를 기준으로 JOIN 기준 테이블의 모든 key 값에 대해 적용)
- NON_Equi JOIN (CROSS JOIN)두 테이블의 같은 column 을 사용하지 않고 join
사원의 이름, 급여, 급여의 등급을 표시SELECT e.ENAME, e.SAL, g.GRADE FROM EMP e, SALGRADE g WHERE e.SAL BETWEEN g.LOSAL AND g.HISAL
================ inline view =====================================
-> 실제 존재하지 않는 테이블이지만 연산을 위해 가상으로 생성
부서평균연봉보다 많이 받는 사원의 이름과 연봉, 부서평균연봉을 조회
SELECT ENAME, SAL, DEPT_AVG FROM EMP INNER JOIN (SELECT DEPTNO, round(AVG(SAL)) AS DEPT_AVG FROM EMP GROUP BY DEPTNO) DEPT ON EMP.DEPTNO = DEPT.DEPTNO WHERE SAL > DEPT_AVG


============================FUNCTION==============================


DECODE - Oracle 함수 ( = CASE WHEN)
DECODE(column_name, value,
CLERK -> GOOD / ANALYST -> NOT GOOD / BAD
SELECT JOB, DECODE(JOB, 'CLERK', 'GOOD', DECODE(JOB, 'ANALYST', 'NOT GOOD', 'BAD')) as test FROM EMP
-->
SELECT JOB, CASE JOB WHEN 'CLERK' THEN 'GOOD' WHEN 'ANALYST' THEN 'NOT GOOD' ELSE 'BAD' END as test FROM EMP
2000까지 A 4000 까지 B 나머지 C
SELECT GRADE, LOSAL, HISAL, CASE WHEN HISAL< salgrade ="=" emp ="=" 1="2" dept =" 10" table_name =" 'DOYOUNG'"> table_name


====================== sequence ==================================


연속적인 숫자값을 자동으로 증가/감소 시켜야 할 경우 자동으로 숫자를 발생시키는 객체 즉, 시퀀스를 생성한 후 호출만하면 연속적으로 번호를 (오라클에서) 증가/감소시켜 제공해 준다. CREATE SEQUENCE [시퀀스명] [INCREMENT BY n] [START WITH n] [MAXVALUE n NOMAXVALUE] [MINVALUE n NOMINVALUE] [CYCLE NOCYCLE] [CACHE NOCACHE]
생성 : CREATE SEQUENCE EMP_seq START WITH 3300 INCREMENT BY 100 MAXVALUE 9900 NOCHACHE NOCYCLE
확인 : SELECT * FROM USER_SEQUENCES삭제 : DROP SEQUENCE sequence_name
함수: sequence_name.nextval sequence_name.currval
======================== 여러 테이블 조인 ===================================
-LOCATIONS, DEPARTMENTS, JOBS, EMPLOYEES 테이블 조인
SELECT E.FIRST_NAME, D.DEPARTMENT_NAME, J.JOB_TITLE, L.CITY FROM LOCATIONS L, DEPARTMENTS D, JOBS J, EMPLOYEES E WHERE L.LOCATION_ID = D.LOCATION_ID AND E.DEPARTMENT_ID = D.DEPARTMENT_ID AND E.JOB_ID = J.JOB_ID
->
SELECT E.FIRST_NAME, D.DEPARTMENT_NAME, J.JOB_TITLE, L.CITY FROM LOCATIONS L INNER JOIN DEPARTMENTS D ON L.LOCATION_ID = D.LOCATION_ID INNER JOIN EMPLOYEES E ON E.DEPARTMENT_ID = D.DEPARTMENT_ID INNER JOIN JOBS J ON E.JOB_ID = J.JOB_ID
- IN 절로 EMPLOYEES 테이블과 DEPARTMENT 테이블을 조인
- employee 테이블을 조회하면서 부서이름을 조회하고 싶은 경우 스칼라 서브쿼리 사용 작성
SELECT E.FIRST_NAME, (SELECT D.DEPARTMENT_NAME FROM DEPARTMENTS D WHERE D.DEPARTMENT_ID = E.DEPARTMENT_ID) DEPARTMENT_NAME FROM EMPLOYEES E
--> OUTER JOIN과 동일
SELECT E.FIRST_NAME, D.DEPARTMENT_NAME FROM EMPLOYEES E LEFT OUTER JOIN DEPARTMENTS D ON E.DEPARTMENT_ID = D. DEPARTMENT_ID

========================== VIEW =============================


- 부서별 평균연봉 뷰
CREATE VIEW DEPT_AVG_SAL_VIEW AS SELECT D.DEPTNO, D.DNAME, E.SAL_AVG FROM DEPT D, (SELECT DEPTNO, AVG(SAL) SAL_AVG FROM EMP GROUP BY DEPTNO) E
- 뷰를 이용해서 부서의 평균 급여보다 적은 급여를 받는 사원 조회
SELECT E.ENAME, E.SAL, V.SAL_AVG FROM EMP E INNER JOIN DEPT_AVG_SAL_VIEW V ON E.DEPTNO = V.DEPTNO WHERE E.SAL < sal_avg ="=" index ="=" index_name =" ix.index_name" table_name =" 'EMP'" index_name ="=" recursive ="=" empno =" MGR" mgr =" prior">



UNIX Directory Commands
mkdir [name] : Makes a directory of file group name
cd [directory] : Changes the working directory
pwd : Displays working directory
mv [file1]..[fileN] [directory] : moves file1,..,fileN to directory
cp [file1] [directory]/[file2] : copies [file1] into [file2] in directory [directory]
rmdir [directory] : Removes or erases empty directory
UNIX File Commands
ls -[option] lists files
lists files in 'long format', which contains lost of useful information, e. g.
- l the exact size of the file, who owns the file and who has the right to look at it
and when it was last modified.

ln -[option] filename(to link) filename(to generate) Link file generate (hard link)
-s symbol link

mv filename new_filename rename file(s) and directory(ies)
mv filename directory move file(s) and directory(ies)\
cp filename1 filename2 copies a file

rm -[option] filename(s)
-i Prevent the accidental removal(interactive)
-f Remove files whether write-protected or not
-r Recursively remove directories and subdirectories in the argument list


cat > file_name : 파일에 내용 덮어씌우기
cat >> file_name : 파일에 내용 이어 붙이기
touch file_name : 빈 파일 생성