Tuesday, November 15, 2011

Connection authorization failure occurred. Reason: Security mechanism not supported. ERRORCODE=-4214, SQLSTATE=28000

If you get mentioned error



Exception in thread "main" com.ibm.db2.jcc.b.bo: [jcc][t4][201][11237][3.53.95]
Connection authorization failure occurred.  Reason: Security mechanism not supported. ERRORCODE=-4214, SQLSTATE=28000
        at com.ibm.db2.jcc.b.bd.a(bd.java:674)
        at com.ibm.db2.jcc.b.bd.a(bd.java:60)
        at com.ibm.db2.jcc.b.bd.a(bd.java:120)
        at com.ibm.db2.jcc.t4.b.o(b.java:1981)
        at com.ibm.db2.jcc.t4.b.a(b.java:1554)
        at com.ibm.db2.jcc.t4.bb.b(bb.java:3405)
        at com.ibm.db2.jcc.t4.bb.a(bb.java:332)
        at com.ibm.db2.jcc.t4.bb.a(bb.java:112)
        at com.ibm.db2.jcc.t4.b.l(b.java:1247)
        at com.ibm.db2.jcc.t4.b.b(b.java:1120)
        at com.ibm.db2.jcc.t4.b.c(b.java:707)
        at com.ibm.db2.jcc.t4.b.b(b.java:693)
        at com.ibm.db2.jcc.t4.b.a(b.java:376)
        at com.ibm.db2.jcc.t4.b.(b.java:312)
        at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:214)
        at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:224)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)


As the error suggest, You are not authorized to access the database. I am not sure on this, possibly this could be the one reason for the above error.


Try using different Driver,


I was using DB2 Universal Driver, when i got above error

Class.forName("com.ibm.db2.jcc.DB2Driver");
con=DriverManager.getConnection("jdbc:db2://hostname:port/Schema","username","password");

Jar file : db2jcc.jar


I switched to App JDBC Driver, and it solved the error.

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
con=DriverManager.getConnection("jdbc:db2:Test","uername","passowrd");

Jar file : db2java.jar


To download Jar files : Click here

If still you face the issue, contact your server administrator.

No comments:

Post a Comment