啥错误?
jdbc:oracle:thin:@127.0.0.1:1521:OR9
-->
jdbc:oracle:thin:@localhost:1521:OR9

解决方案 »

  1.   

    Errors     Variable  connection is already defined in constructor DisplayAuthors() at line 22第22行:Connection connection = DriverManager.getConnection(url, user, password);
      

  2.   

    倒,connection你不是已经定义了吗?Connection connection = null;
    所以不要再重复定义
    Connection connection = DriverManager.getConnection(url, user, password);
    -->
    connection = DriverManager.getConnection(url, user, password);
      

  3.   

    改了:
    Errors:
       Unreported exception: java.lang.IllegalAccessException,must be caught or declared to throw at line 18
       Unreported exception: java.lang.IllegalAccessException,must be caught or declared to throw at line 18第十八行:      Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
      

  4.   

    要捕捉异常,加上
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    }catch(Exception e){}
      

  5.   

    Class.forName("oracle.jdbc.driver.OracleDriver");
    就可以了吧,不用
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();