I'm trying to connect to MySQL using the following JAVA code. However, I'm getting an SQLException (connection cannot be established)
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
class Jdbctest {
public static void main(final String args[]) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
// for establishing connection, cnn is object of connection
final Connection cnn = DriverManager.getConnection("jdbc:oracle:thin:@//192.68.11.128:1521/orcl");
System.out.println("connection to db");
} catch (final ClassNotFoundException e) {
System.out.println(e);
} catch (final SQLException e) {
System.out.println(e);
}
}
}