ORA-12705: Cannot access NLS data files or invalid environment specified
- by Mohit Nanda
I am getting this error while trying to create a connection pool, on my Oracle database, Oracle 10gR2.
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified
I am able to connect to the database over sqlplus & iSQLPlus client, but when I try to connect using this Java program, I get this error just when the connection pool is to be initialised and it does not initialise the connection pool.
Can someone please help me resolving it?
DB Version: Oracle version 10.2.0.1
OS: RHEL 4.0
Here is a barebone, java code which is throwing this error, while connecting to my database.
import java.sql.*;
public class connect{
public static void main(String[] args) {
Connection con = null;
CallableStatement cstmt = null;
String url = "jdbc:oracle:thin:@hostname:1521:oracle";
String userName = "username";
String password = "password";
try
{
System.out.println("Registering Driver ...");
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
System.out.println("Creating Connection ...");
con = DriverManager.getConnection(url, userName, password);
System.out.println("Success!");
} catch(Exception ex) {
ex.printStackTrace(System.err);
} finally {
if(cstmt != null) try{cstmt.close();}catch(Exception _ex){}
if(con != null) try{con.close();}catch(Exception _ex){}
}
}
}