安装oracle的时候ORA12705,oracle – ORA-12705:无法访问NLS数据文件或指定的无效环境...

我在尝试在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){}

}

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值