I try to connect from my little Java class to Oracle11g database and connection was refused with a SQL error.
From client (SQL Developer) connection works.
This is the ERROR when I try to run java class:
java.sql.SQLException:
ORA-00604: errore riscontrato in SQL ricorsivo livello 1
ORA-20001: Denied! You are not allowed to logon the database
ORA-06512: a line 19
at oracle.jdbc.driver.T4CTTIo`enter code here`er.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:675)
at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:448)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:383)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:776)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:432)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at DBConnection.setDBConnection(DBConnection.java:48)
at Main.main(Main.java:31)
This is the code of my connection class:
String host = "xxx";
String service = "xxx";
String username = "xxx";
String password = "xxx";
if(host != null && username != null && password != null) {
// Establishing DB Connection
try {
connection = DriverManager.getConnection(
"jdbc:oracle:thin:@" + host + ":1521/" + service , username, password);
...
ORA-20001
is a custom error. Possibly caused by foolish security measures. dba.stackexchange.com/questions/93949/…