Oracle_ojdbc6 使用 报错

via: http://sd8089730.iteye.com/blog/1574884

 

执行java应用 java -Djava.ext.dirs=./lib -classpath classes test.Test

报错,但配置文件都正确

java.sql.SQLException: ORA-01005: null password given; logon denied  

  

        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.ja  

va:70)  

        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:1  

12)  

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java  

:173)  

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)  

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)  

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)  

        at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthentica  

te.java:794)  

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:391)  

        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:  

490)  

        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)  

        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio  

n.java:33)  

        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)  

        at java.sql.DriverManager.getConnection(Unknown Source)  

        at java.sql.DriverManager.getConnection(Unknown Source)  

 

        at test.Test.main(Test.java:18) 

 

解决方法  添加 jar包sunjce_provider.jar (which is in the JDK_DIR/jre/lib/ext folder).

你可能感兴趣的:(oracle)