Error connecting Oracle SQL Developer 4.1.2.20 to Oracle XE 11.2 in UBUNTU

2

I have the following error when trying to connect to Oracle XE from SQL Developer

Se ha producido un error al realizar la operación solicitada:

    ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: Cannot access NLS data files or invalid environment specified
    00604. 00000 -  "error occurred at recursive SQL level %s"
    *Cause:    An error occurred while processing a recursive SQL statement
               (a statement applying to internal dictionary tables).
    *Action:   If the situation described in the next error on the stack
               can be corrected, do so; otherwise contact Oracle Support.
    Código de proveedor 604

Only from that app I can not connect, it's more I tried the connection mediated by JBDC and it does me wonders.

package py.conexion;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Conexion {

private static String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";

    introducir el código aquí
    protected String host = "127.0.0.1";
    protected String port = "1521";
    protected String dbname = "xe";
    protected String user = "usuario";
    protected String password = "password";


    private static Logger logger = Logger.getLogger("DBAccessOracle");
    private Connection conn;

    public Connection getConnection() throws SQLException {
        try {
            Class.forName(ORACLE_DRIVER);
        } catch (ClassNotFoundException e) {
            logger.log(Level.SEVERE, "ClassNotFoundException: " + e.getMessage());
        }

        String url = "jdbc:oracle:thin:@" + host + ":" + port + "/" + dbname; // SERVICE

        System.out.println(url);
        conn = DriverManager.getConnection(url, user, password);
        return conn;

    }

    public static void main(String[] args) {
        try {
            Conexion c = new Conexion();
            System.out.println(c.getConnection().getMetaData().getDatabaseMajorVersion());
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

}

One help please

    
asked by Leketo 12.04.2016 в 03:37
source

1 answer

3

To correct the error thrown by SQL Developer what worked for me after trying thousands of things without any success was to modify the configuration used:

You must open the file

[SQL DEVELOPER INSTALATION PATH]\sqldeveloper\bin\sqldeveloper.conf

and add the following lines

AddVMOption  -Duser.region=us
AddVMOption  -Duser.language=en

The US region and the EN language must work for any installation language (it is the default language of the engine).

I hope it serves you!

    
answered by 21.03.2017 в 20:43