자바 JDBC 연결 소스 코드

test.java
-----------------------------------------------------------------------------------------------------

import java.sql.*;

  public class Test
    {
         public static void main( String[] args)
          {
         Connection conn = null;
         String url= "jdbc:informix-sqli://kr004798:9088/sample:INFORMIXSERVER=testServer";
/* jdbc:informix-sqli://[hostname]:[port number]/[DB name]:INFORMIXSERVER=[server name] */
            try {
                  Class.forName("com.informix.jdbc.IfxDriver").newInstance();
                  conn = DriverManager.getConnection(url,"informix","kr004798");
                  System.out.println("Succefully Loaded Informix JDBC Driver.....");
                  conn.close();
            }
            catch(Throwable e)
                {
                   System.out.println(e);
                }
           }
    }

신고
Posted by babovirus


티스토리 툴바