자바를 연결하려고 합니다.

by 하이에나 posted Nov 09, 2009

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
//import cubrid.jdbc.driver.CUBRIDDriver;
public class setNation
{
  public static void main (String[]args) throws Exception
  {
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      // CUBRID Connect
      Class.forName ("cubrid.jdbc.driver.CUBRIDDriver");
      conn =
        DriverManager.getConnection ("jdbc:CUBRID:127.0.0.1:33000:smdocu:::",
                                     "dba", "dba");
      System.out.println("큐브리드 접속성공");
    }

    catch (Exception e)
    {
      System.out.println (e.toString());
    }
    finally
    {
      if (conn != null)
        conn.close ();
    }
  }
}

소스는 이렇습니다.
에러메세지는
java.lang.ClassNotFoundException : cubrid.jdbc.driver.CUBRIDDriver
이렇게 나옵니다.

ClassPath 는 C:CUBRIDjdbccubrid_jdbc.jar 이렇게 추가해 주었습니다.

울고 싶어지네요 ㅠㅠ


Articles