Versão atual:

Erro de conexão Java + Oracle

Estou iniciando em JAVA + Oracle e estou tendo problemas para criar a classe conexão. Está aparecendo a mensagem de erro:

Mensagem de erro

Exception in thread "main" java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/sql/converter/CharacterConverters;
    at oracle.sql.converter.CharacterConverterFactoryOGS.make(CharacterConverterFactoryOGS.java:48)
    at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:92)
    at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:123)
    at oracle.sql.CharacterSet.make(CharacterSet.java:443)
    at oracle.jdbc.driver.DBConversion.init(DBConversion.java:153)
    at oracle.jdbc.driver.DBConversion.<init>(DBConversion.java:117)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:913)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:269)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:215)
    at msv.conexao.getConnection(conexao.java:26)
    at msv.conexao.main(conexao.java:31)
Java Result: 1

Minha classe conexão é

package pacote;
import java.sql.Connection;  
import java.sql.DriverManager;  
import java.sql.SQLException;  
/**
 *
 * @author h.coutinho
 */
public class conexao {
    private static conexao conexaoUtil;  

    public static conexao getInstance(){  
        if (conexaoUtil == null){  
            conexaoUtil = new conexao();  
        }  
        return conexaoUtil;  
    }  

    public Connection getConnection() throws ClassNotFoundException, SQLException{  
        Class.forName("oracle.jdbc.OracleDriver");  
        return DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.7:1521:banco","usuario","senha");  
    }  

    public static void main(String[] args) {  
        try {  
            System.out.println(getInstance().getConnection());  
            System.out.println("conectado!");  
        } catch (Exception e) {  
            e.printStackTrace();  
        }  

    }  
}

Versões(2):

Ver a versão formatada

Erro de conexão Java + Oracle

Comentário

new question