0

I want to retrieve data from Oracle SQL developer and display it into the Java program.But still I couldn't connect with SQL Developer and following error is occurred when try to retrieve data.

enter image description here

My db connection class in program as follow,

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection c = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","dmusers","123");

In sql developer database connection,

Enter image description here

Asbar Ali
  • 955
  • 1
  • 13
  • 26
  • looks to me like db is down – ajay.patel Sep 15 '17 at 02:40
  • Why: "com.mysql.jdbc.Driver" ? Are you connecting to Oracle or MySQL? – VinhNT Sep 15 '17 at 02:46
  • Please read [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) before attempting to ask more questions. –  Sep 15 '17 at 02:59
  • Please read [Why is “Can someone help me?” not an actual question?](https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question) before attempting to ask more questions. –  Sep 15 '17 at 02:59

2 Answers2

-1

1) First you should check you have database orcl in MySQL DB?

jdbc:mysql://localhost:1521/orcl

2) Is MySQL jdbc driver jar file added into SQL developer? If not, add it. it will work.

Anil K
  • 110
  • 9
-1

Try this: Class.forName("oracle.jdbc.driver.OracleDriver"); And makesure you have the driver file for jdbc oracle in your classpath

VinhNT
  • 1,091
  • 8
  • 13