블로그 이미지
좋은느낌/원철
이것저것 필요한 것을 모아보렵니다.. 방문해 주셔서 감사합니다..

calendar

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Notice

    2008. 6. 30. 17:00 개발/DB2

    출처 : http://database.sarang.net/?inc=read&aid=867&criteria=db2&subcrit=&id=&limit=20&keyword=jdbc&page=1



    v8 이전의 JDBC driver을 DB2 JDBC drvier라고 하고,

    v8 이후에 새롭게 추가된 JDBC driver를 Universal JDBC driver라고 명명하고 설명합니다.

    v8 이상에서는 Universal JDBC Driver를 사용할 것을 권장합니다.


    Class files

    - db2java.zip : DB2 JDBC Type 2 and Type 3 Driver

    - db2jcc.jar   : Universal Type 2 and Type 4 Driver

    License jar files (Universal JDBC driver를 사용할 때 필요)

    - db2jcc_license_cu.jar : for connecting DB2 v8 for LUW

    - db2jcc_license_cisuz.jar : for connecting DB2 for iSeries and z/OS

    JDBC Drvier class name

    - DB2 JDBC Type 2 Driver : COM.ibm.db2.jdbc.app.DB2Driver

    - DB2 JDBC Type 3 Driver : COM.ibm.db2.jdbc.net.DB2Driver

    - Universal JDBC Type 2 Driver : com.ibm.db2.jcc.DB2Driver

    - Universal JDBC Type 4 Driver : com.ibm.db2.jcc.DB2Driver

    JDBC url name

    - DB2 JDBC Type 2 Driver : jdbc:db2:db_name

    - DB2 JDBC Type 3 Driver : jdbc:db2://host_name:port_name/db_name

    - Universal JDBC Type 2 Driver : jdbc:db2:sample

    - Universal JDBC Type 4 Driver : jdbc:db2://host_name:port_name/db_name


    Sample program

    import java.sql.*;
    Connection con;
    Statement stmt;
    ResultSet rs;
    Class.forName(“com.ibm.db2.jcc.DB2Driver”);
    con = DriverManager.getConnection(“db2:jdbc://server1:50000/sample”);
    stmt = con.createStatement();
    rs = stmt.executeQuery(“select EMPNO from EMPLOYEE”);
    while (rs.next()) {
    s = rs.getString(1);
    }
    rs.close();
    stmt.close();
    con.close();

    DB2 and JAVA Developer Domain

     http://www7b.boulder.ibm.com/dmdd/zones/java/

    posted by 좋은느낌/원철