Database connection error

Asked

Viewed 73 times

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?

  • 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

  • You are using the Maven?

  • Yes, I am wearing.

  • Error occurs running inside the eclipse?

  • Yes, inside the eclipse.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.