본문 바로가기

Java & Html

각 경우별 드라이버 연동하기

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
//********** 각 경우별 드라이버 연동하기 **************/

** DB2 **
연결 URL : "jdbc:db2:Catalog된 DB명"
드라이버 클래스 : COM.ibm.db2.jdbc.app.DB2Driver

** JDK jdbc-odbc driver (Type1) **
연결 URL : "jdbc:odbc:"
드라이버 클래스 : sun.jdbc.odbc.JdbcOdbcDriver

** Oracle thin driver (Type4) **
연결 URL : "jdbc:oracle:thin:@:port:"
드라이버 클래스 : oracle.jdbc.driver.OracleDriver

** Oracle oci driver (Type2) **
연결 URL : "jdbc:oracle:oci:@"
드라이버 클래스 : oracle.jdbc.driver.OracleDriver

** Sybase jConnect driver (Type2) **
연결 URL : "jdbc:sybase:Tds::"
드라이버 클래스 : com.sybase.jdbc2.jdbc.SybDriver

** Informix JC1 driver (Type4) **
연결 URL : "jdbc:informix-sql://:/:INFORMIXSERVER"
드라이버 클래스 : com.informix.jdbc.IfxDriver

** mSQL Imaginary JDBC driver (Type4) **
연결 URL : "jdbc:msql://:/"
드라이버 클래스 : com.imaginary.sql.msql.MsqlDriver

** Postgres driver (Type4) **
연결 URL : "jdbc:postgresql://:/"
드라이버 클래스 : postgresql.driver

** MM MySQL driver (Type4) **
연결 URL : "jdbc:mysql://:/"
드라이버 클래스 : org.git.mm.mysql.Driver



** Access **

연결 URL : jdbc:odbc:설정한 odbc명

드라이버 클래스 : sun.jdbc.odbc.JdbcOdbcDriver


mysql은 JConnector 3.0 부터는 com.mysql.jdbc.Driver

연결 URL 은 jdbc:mysql://localhost/dbname?Unicode=true&characterEncoding=EUC_KR

같이 인코딩 타입을 직접 줌으로써 한글 변환문제에 좀더 쉽게 해결할 수 있음.



// ******************************Connected To IBM AS/400

Class.forName("com.ibm.as400.access.AS400JDBCDriver");
com = Driver.Manager.getConnection("jdbc:as400://10.20.30.40/testlib;user=user;password=pass");

// ******************************Connected To Unisql

Class.forName("unisql.jdbc.driver.UniSQLDriver");
con = Driver.Manager.getConnection("jdbc:unisql:10.20.30.40:43300:demodb:::", "user","pass");


// ******************************Connected To Jdbc-Odbc Type - 1 Driver

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// con = DriverManager.getConnection("Jdbc:Odbc:dsnname","userid","password");
con = DriverManager.getConnection("jdbc:odbc:Driver={SQL Server};Server=servername;Database=pubs","userid","password");

// ******************************Connected To Ms-Access JDBC ODBC Driver .

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("Jdbc:Odbc:dsnname","","");
// con = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=G:/admin.mdb","","");

// ******************************Connected To Ms-Access Type-3 Driver.

Class.forName ("acs.jdbc.Driver");
String url = "jdbc:atinav:servername:5000:C:\admin.mdb";
String username="Admin";
String password="";
Connection con = DriverManager.getConnection(url,username,password);

// ******************************Connected To Microsoft SQL.

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con = DriverManager.getConnection("jdbc:microsoft:sqlserver://servername:1433","userid","password");

// ******************************Connected To Merant.

Class.forName("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver");
con = DriverManager.getConnection("jdbc:merant:sqlserver://servername:1433;User=userid;Password=password");

// ******************************Connected To Atinav SqlServer.

Class.forName ("net.avenir.jdbc2.Driver");
con= DriverManager.getConnection("jdbc:AvenirDriver://servername:1433/pubs","userid","password");

// ******************************Connected To J-Turbo.

String server="servername";
String database="pubs";
String user="userid";
String password="password";

Class.forName("com.ashna.jturbo.driver.Driver");
con= DriverManager.getConnection("jdbc:JTurbo://"+server+"/"+database,user,password);

// ******************************Connected To jk Jdbc Driver.

String url= "jdbc:jk:server@pubs:1433";
Properties prop = new Properties();
prop.put("user","userid");//Set the user name
prop.put("password","password");//Set the password

Class.forName ("com.jk.jdbc.Driver").newInstance();
con = DriverManager.getConnection (url, prop);*/

// ******************************Connected To jNetDirect Type - 4 Driver

String sConnect = "jdbc:JSQLConnect://127.0.0.1/database=pubs&user=userid&password=password";
Class.forName ("com.jnetdirect.jsql.JSQLDriver").newInstance();
Connection con= DriverManager.getConnection(sConnect);

// ******************************Connected To AvenirDriver Type - 4 Driver

// String url= "jdbc: AvenirDriver: //servername:1433/pubs";
// java.util.Properties prop = new java.util.Properties ();
// prop.put("user","userid");
// prop.put("password","password");

Class.forName ("net.avenir.jdbc2.Driver");
System.out.println(" Connected To AvenirDriver Type - 4 Driver");
con= DriverManager.getConnection("jdbc:AvenirDriver://servername:1433/pubs","userid","password");

// ******************************Connected To iNet Sprinta2000 Type - 4 Driver

String url="jdbc:inetdae7:servername:1433";
String login="userid";
String password="password";
Class.forName("com.inet.tds.TdsDriver");
System.out.println(" Connected To iNet Sprinta2000 Type - 4 Driver");
con=DriverManager.getConnection(url,login,password);

// ******************************Connected To iNet Opta2000 Type - 4 Driver
String url="jdbc:inetdae7:servername:1433";
String login="sagar";
String password="sagar";
Class.forName("com.inet.tds.TdsDriver").newInstance();
System.out.println(" Connected To iNet Opta2000 Type - 4 Driver");
con=DriverManager.getConnection(url,login,password);

'Java & Html' 카테고리의 다른 글

Java Map(HashMap, TreeMap, Hashtable)  (0) 2010.08.27
자바 환경변수 세팅  (0) 2010.08.27
Ajax 기본  (0) 2010.08.27
자바 반올림, 내림, 올림  (0) 2010.08.26
자바의 지역, 맴버변수  (0) 2010.08.17