java.sql.SQLException:ORA-01005:给出了空密码;登录被拒绝 [英] java.sql.SQLException: ORA-01005: null password given; logon denied

查看:1458
本文介绍了java.sql.SQLException:ORA-01005:给出了空密码;登录被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试连接数据库时出现以下异常:

I'm getting the follwing exception while trying to connect to a database:

java.sql.SQLException: ORA-01005: null password given; logon denied
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:392)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:385)
        at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:938)
        at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:480)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:655)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
        at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:416)
        at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:825)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:596)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:715)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:385)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:564)
        at java.sql.DriverManager.getConnection(DriverManager.java:675)
        at java.sql.DriverManager.getConnection(DriverManager.java:258)
        at com.alting.db.ManagerDB.getConnection(ManagerDB.java:57)
        at com.alting.db.ManagerDB.openConnection(ManagerDB.java:75)
        at com.alting.med.EventGenerator.exportData(EventGenerator.java:220)
        at com.alting.med.Main.main(Main.java:252)

此处是用于获得连接的方法:

here the method used to get the connection:

private Connection getConnection(String url, String driverClass, String user, String password) throws ManagerDBException 
{
    try
    {
        Class.forName(driverClass);
    } catch (ClassNotFoundException e) {
        throw new ManagerDBException(e.getMessage());
    }

    try
    {
      this.connection = DriverManager.getConnection(url, user, password);
    }
    catch (SQLException e)
    {
      throw new ManagerDBException(e.getMessage());
    }
    return this.connection;
}

但是即使对参数(URL,密码..)进行了硬编码,我仍然会遇到异常.

But even when the params (url, password..) are hardcoded, I still get the exception.

您能告诉我如何解决此问题吗? 谢谢

Could you tell me how to fix this problem ? thanks

推荐答案

看来问题是从Java启动命令行链接到"-Djava.endorsed.dirs"参数的.

it appears the problem is linked to the "-Djava.endorsed.dirs" parameter from the java startup command line.

通过删除这一部分,一切顺利.

By removing this one, everything goes well.

这篇关于java.sql.SQLException:ORA-01005:给出了空密码;登录被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆