본문 바로가기
JAVA

DataBase별 JDBC 설정

by eqzero 2006. 11. 12.

원본 글 : http://www.jakartaproject.com/article/jsptip/113348626476500

ⓐ Oracle
 oracle.jdbc.driver.OracleDriver
 jdbc:oracle:thin:@hostname:port:SID
 String url = "jdbc:oracle:thin:@localhost:1521:ORA8";
 Class.forName("oracle.jdbc.driver.OracleDriver“);

ⓑ mssql
 com.jk.jdbc.Driver
 jdbc:jk://hostname:port/database=db_name
 String url="jdbc:jk://localhost:1433/database=CRM";
 Class.forName("com.jk.jdbc.Driver“);
 
ⓒ mysql
 orj.gjt.mm.mysql.Driver
 jdbc:mysql://db_url:port/db_name
 String url = "jdbc:mysql://localhost:3306/CRM";
 Class.forName("orj.gjt.mm.mysql.Driver“);
 
ⓓ sybase
 com.sybase.jdbc2.jdbc.SybDriver
 jdbc:sybase:Tds:db_url:port/db_name
 String url = "jdbc:sybase:Tds:localhost:3344/CRM";
 Class.forName("com.sybase.jdbc.jdbc.SybDriver“);

ⓔ db2
 COM.ibm.db2.jdbc.app.DB2Driver
 jdbc:db2://172.58.654.356:port/db_name
 String url = "jdbc:db2://localhost:9010/CRM";
 Class.forName("COM.ibm.db2.jdbc.app.DB2Driver“);
 
ⓕ postgresql
 7.0 version : org.postgresql.Driver
 6.5 version : postgresql.Driver
 jdbc:postgresql:db_name
 jdbc:postgresql://host/db_name
 jdbc:postgresql://host:port/db_name
 String url = "jdbc:postgresql://localhost:5432/CRM";
 Class.forName("org.postgresql.Driver“); -> version 7.0
 Class.forName("postgresql.Driver“); -> version 6.5

ⓖ informix
 com.informix.jdbc.IfxDriver
 jdbc:informix-sqli://hostname:port/db_name:INFORMIXSERVER=server_name:user=user_name:password=user_pwd
 String url = "jdbc:informix-sqli://localhost:2020/CRMl:INFORMIXSERVER=mydb:user=sys:password=pass";
 Class.forName("com.informix.jdbc.IfxDriver“);

ⓗ odbc brigde
 sun.jdbc.odbc.JdbcOdbcDriver
 jdbc:odbc:source-name
 String url = "jdbc:odbc:CRM";
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver“); 

ⓘ teradata
 com.ncr.teradata.TeraDriver
 jdbc:teradata://host:port/gateway/tmode=default

 

댓글0