0
When trying to make a connection to the dodo bank I have the following error:
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@delphix-db-1.homolog.infra:1521:BRMQA10 at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at br.com.oiinternet.oitestautomation.sga.page.DataBase.main(DataBase.java:28)
Follow the code I’m using:
package br.com.oiinternet.oitestautomation.sga.page;
import java.sql.Connection;
import java.sql.DriverManager;
public class DataBase {
public static void main(String[] args) {
String sql;
/*
* O driver JDBC do Oracle está disponível no seguinte endereço:
* http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
*/
// Configuração dos parâmetros de conexão
String server = "delphix-db-1.homolog.infra";
String port = "1521";// Porta TCP padrão do Oracle
String database = "BRMQA10";
// Configuração dos parâmetros de autenticação
String user = "****";
String passwd = "*****";
try {
String url = "jdbc:oracle:thin:@" + server + ":" + port + "/" + database;
// String url = "jdbc:oracle:thin:@""delphix-db-1.homolog.infra:1521/BRMQA10";
/// Abre-se a conexão com o Banco de Dados
Connection con = DriverManager.getConnection(url, user, passwd);
con.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Data of the Bank:
host name: Delphix-db-1.homolog.infra door : 1521 Service name: BRMQA10
How to correct this error ?
You added the Oracle jdbc driver to classpath?
– Murillo Goulart
Yes, I downloaded direct from this site :http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html I went to add External jars and add straight to the eclipse
– Renato
You are using the Maven?
– Roknauta
Yes, I am wearing.
– Renato
Error occurs running inside the eclipse?
– Murillo Goulart
Yes, inside the eclipse.
– Renato