我在尝试在Oracle数据库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
我可以通过sqlplus& amp; iSQLPlus客户端,但是当我尝试使用这个Java程序进行连接时,我只是在初始化连接池并且没有初始化连接池时才会收到此错误.
有人可以帮我解决一下吗?
数据库版本:Oracle 10.2.0.1版
操作系统:RHEL 4.0
这是一个准系统,java代码在连接到我的数据库时抛出此错误.
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){}
}
}
}