Vendor DBMSÀÎ Informix Database¿¡ JDBC¸¦ ÀÌ¿ëÇÏ¿© Á¢±ÙÇÏ´Â ¹æ¹ýÀ» ¾Ë¾Æº¸µµ·Ï ÇÑ´Ù.
ÇöÀç ¸¹Àº ¼öÀÇ µ¥ÀÌÅͺ£À̽º¿£Áø vendor°¡ Á¸ÀçÇÑ´Ù. IBMÀÇ Àμö·Î ´õ¿í È®ÀåµÈ informixµ¥ÀÌÅÍ
º£À̽º¿¡ ´ëÇÏ¿© ¾Ë¾Æº»´Ù.
ÀÚ¹Ù¿¡¼ µ¥ÀÌÅͺ£À̽º´Â sun¿¡¼ Á¦°øµÈ spec¿¡ ¸Â°Ô²û °¢°¢ÀÇ º¥´õµéÀÌ interface¸¦ ±¸ÇöÇÏ¿©
ÇÁ·Î±×·¥À» Â¥´Â ÇÁ·Î±×·¡¸ÓÃø¸é¿¡¼´Â ¾ÆÁÖ ½±°Ô µ¥ÀÌÅͺ£À̽º¸¦ ±âÁ¾¿¡ »ó°ü¾øÀÌ Çڵ鸵ÇÒ¼ö
ÀÖ´Â ÀåÁ¡À» Á¦°øÇÏ°í Àִ°ÍÀÌ´Ù.
ÇöÀç Informix´Â type1~type4±îÁö ¸ðµÎ Áö¿øÇÏ°í ÀÖÀ¸¸ç, »ùÇøµ ¹®¼´Â ¾Æ·¡ÀÇ ¸µÅ©¿¡¼ ãÀ»¼ö ÀÖ´Ù
http://examples.informix.com/frameset.html
import java.sql.*;
public class InformixTest {
public static void main(String args[]) {
String cmd = null;
int rc;
Connection conn = null;
String driver = "com.informix.jdbc.IfxDriver";
// jdbc:informix-sqli://db_host(IP):db_port(db port)/db_name(db À̸§):
// informixserver=db_server(db Server À̸§)
// URL = "jdbc:informix-sqli://myhost:1533/testDB:informixserver=myserver;user=rdtest;password=test"
String url = "jdbc:informix-sqli://" +db_host+":"+db_port+"/"+db_name+
":informixserver=" + db_server+user_id+user_passwd;
try {
Class.forName("com.informix.jdbc.IfxDriver");
}catch (Exception e){
System.out.println("ERROR: Informix JDBC driver not found");
}
try{
conn = DriverManager.getConnection(url);
}catch (SQLException e) {
System.out.println("ERROR: failed to connect!");
}try {
DatabaseMetaData metadata = conn.getMetaData();
System.out.println(metadata.getDatabaseProductName());
}
catch (SQLException e) {
System.out.println("ERROR: execution failed - statement: " + cmd);
System.out.println("ERROR: " + e.getMessage());
}
finally {
try {conn.close();} catch(Exception e) {}
}
}
}
ArticleÁ¤¸® :
ÇØ´çµÇ´Â µ¥ÀÌÅͺ£À̽º¿¡ Á¢¼ÓÀ» ½ÃµµÇغ¸¾Ò´Ù. ´ÙÀ½¿¡ ÷ºÎµÇ´Â ÆÄÀÏÀº Informix¿¡¼ Á¦°øÇÏ´Â
JLoginÇÁ·Î±×·¥À¸·Î AWTÇüÅÂÀÇ ¾ÖÇø®ÄÉÀ̼ÇÀ¸·Î ÇØ´ç JDBCµå¶óÀ̹ö ¹× ½ÇÁ¦·Î pingÅ×½ºÆ®±îÁö
Çغ¼¼ö ÀÖ´Â ÄÚµåµéÀÌ ÀÛ¼ºµÇ¾î ÀÖ´Ù.
Çѹø Å×½ºÆ®Çغ¸½Ã±æ
|