java.lang.ArrayIndexOutOfBoundsException: for jdbc

2019-07-31 10:42发布

问题:

I have no idea why I am getting this error, In the program i am not accessing any array. But its still giving this error.

java.lang.ArrayIndexOutOfBoundsException: 0 at oracle.jdbc.driver.OracleSql.main(OracleSql.java:1666)

I have posted the code below.

public class ItT4 {
public static void main(String[] args) {
    try {
        // loading the class
        Class.forName("oracle.jdbc.driver.OracleDriver");

    } catch (Exception e) {

        e.printStackTrace();
    }
}//closing main
}//closing class 

I have set the class path required for drivers. and even gone through few links in stackoverflow.

Modified

I removed everything and tried printing out the s simple statement. Still i am getting the same error. The code is given below.

public class ItT4 {
public static void main(String[] args) {

    System.out.println("hello boss");
}

}

回答1:

you can follow the following process

  1. click project
  2. click on clean
  3. select your project