如何将class12.zip设置在CLASSPATH里面?

解决方案 »

  1.   

    if the file is in the path of "C:\JdbcDriver",then you should add a line or append in "Autoexec.bat" file as the following:CLASSPATH=%CLASSPATH%;C:\JdbcDriver\class12.zip;
    you should assure that the class12.zip exists
      

  2.   

    我的系统是win2000,你能告诉我是否可以在jbuilder6里面设置这个属性吗?如何设置?
      

  3.   

    你可以将class.forName(....)这行代码换成:
    DriverManager.registerDriver(new oracle.jdbc.driver.oracleDriver());
      

  4.   

    我在jbuilder6里面照你的提示改了代码,但是编译的时候就报错了,说找不到这个oracle.jdbc.driver.OracleDriver类。也许这个方法用jdk手工编译可以通过,但是我现在急需如何在jbuilder6里面编译通过。
      

  5.   

    在JBUILDER6。0中设置非常简单,
    第一步:打开菜单上的tools菜单条,选中Enterprise Setup项,打开后再选择DataBase Drivers标签,选择Add,然后建立你自己起名的drivers lib,其实就是
    用一个名字表示你的class12.zip的位置,非常简单,建立后你可以在DataBase Drivers标签下看见一个与你驱动程序库名相同名字的config文件。
    第二步:在你的工程里,记住是在你的工作的工程里加入这个第一步起了别名的类库,具体是在你的工程上单击右键,选中properties项,然后选中PATH标签,然后在这个标签下在选种Required Libraries标签,然后选择ADD加入第一步起了别名的类库就可以了
      

  6.   

    我照你的方法试了,还是不行,不知道为什么,真是急死我了,是不是jbuilder的问题?
      

  7.   

    那你用billzzt说的方法中加入class111.zip
      

  8.   

    On Win95/Win98/NT:
      - Add [ORACLE_HOME]\jdbc\lib\classes111.zip and
        [ORACLE_HOME]\jdbc\lib\nls_charset11.zip to your CLASSPATH.
        (Add classes12.zip and nls_charset12.zip if JDK 1.2.x is used.)
      - Add [ORACLE_HOME]\jdbc\lib to your PATH.或者将classes12.zip 改名为 classes12.jar,nls_charset12.zip 改为nls_charset12.jar ,然后 copy 到 [java_home]\jre\lib\ext 下面测试代码:/*
     * This sample shows how to list all the names from the EMP table
     *
     * It uses the JDBC THIN driver.  See the same program in the
     * oci8 samples directory to see how to use the other drivers.
     */// You need to import the java.sql package to use JDBC
    import java.sql.*;class Employee
    {
      public static void main (String args [])
           throws SQLException
      {
        // Load the Oracle JDBC driver
        DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());    // Connect to the database
        // You must put a database name after the @ sign in the connection URL.
        // You can use either the fully specified SQL*net syntax or a short cut
        // syntax as <host>:<port>:<sid>.  The example uses the short cut syntax.
        Connection conn =
          DriverManager.getConnection ("jdbc:oracle:thin:@dlsun511:1721:dbms733",
       "scott", "tiger");    // Create a Statement
        Statement stmt = conn.createStatement ();    // Select the ENAME column from the EMP table
        ResultSet rset = stmt.executeQuery ("select ENAME from EMP");    // Iterate through the result and print the employee names
        while (rset.next ())
          System.out.println (rset.getString (1));
      }
    }