Topic
3 replies Latest Post - ‏2009-08-04T21:54:29Z by SystemAdmin
SystemAdmin
SystemAdmin
17917 Posts
ACCEPTED ANSWER

Pinned topic Connection error while connecting to DB2 using Universal JDBC driver

‏2008-06-19T12:34:37Z |
Hi

I am getting following exception when i do Test Connection on WAS 6.1
Can Some one please help me

java.sql.SQLException: jcct420111237http://3.50.152 Connection authorization failure occurred. Reason: Security mechanism not supported. ERRORCODE=-4214, SQLSTATE=28000DSRA0010E: SQL State = 28000, Error Code = -4,214
at com.ibm.db2.jcc.b.wc.a(wc.java:577)
at com.ibm.db2.jcc.b.wc.a(wc.java:57)
at com.ibm.db2.jcc.b.wc.a(wc.java:119)
at com.ibm.db2.jcc.t4.b.l(b.java:1969)
Caused by:
com.ibm.db2.jcc.b.SqlException: jcc107110611http://3.50.152 Caught java.security.InvalidAlgorithmParameterException while initializing EncryptionManager. See attached Throwable for details. ERRORCODE=-4223, SQLSTATE=null
at com.ibm.db2.jcc.b.wc.a(wc.java:55)
at com.ibm.db2.jcc.b.wc.a(wc.java:84)
at com.ibm.db2.jcc.b.ic.<init>(ic.java:87)
at com.ibm.db2.jcc.t4.b.Mc(b.java:2334)
at com.ibm.db2.jcc.t4.b.a(b.java:1266)
at com.ibm.db2.jcc.t4.b.b(b.java:1255)
... 63 more
Caused by:
java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
at com.ibm.crypto.provider.DHKeyPairGenerator.initialize(Unknown Source)
at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:621)
at java.security.KeyPairGenerator.initialize(KeyPairGenerator.java:363)
at com.ibm.db2.j

Message was edited by: PavanChoukhada
Updated on 2009-08-04T21:54:29Z at 2009-08-04T21:54:29Z by SystemAdmin
  • Sawan
    Sawan
    56 Posts
    ACCEPTED ANSWER

    Re: Connection error while connecting to DB2 using Universal JDBC driver

    ‏2008-06-25T11:43:04Z  in response to SystemAdmin
    Which Security mechanism are you trying to use ? Could you refer to the following mechanisms.

    These are the supported mechanisms by IBM Data Server Driver for JDBC and SQLJ

    -CLIENT
    -SERVER
    -SERVER_ENCRYPT
    -DATA_ENCRYPT
    -KERBEROS
    -GSSPLUGIN
    -KRB_SERVER_ENCRYPT
    -GSS_SERVER_ENCRYPT
    http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.apdv.java.doc/doc/c0052984.html
    • SystemAdmin
      SystemAdmin
      17917 Posts
      ACCEPTED ANSWER

      Re: Connection error while connecting to DB2 using Universal JDBC driver

      ‏2008-07-01T11:41:58Z  in response to Sawan
      Problem is resolved, I was having wrong database server name
      • SystemAdmin
        SystemAdmin
        17917 Posts
        ACCEPTED ANSWER

        Re: Connection error while connecting to DB2 using Universal JDBC driver

        ‏2009-08-04T21:54:29Z  in response to SystemAdmin
        I was also getting the error:
        "com.ibm.db2.jcc.b.SQLException: Connection authorization failure occurred. Reason: security mechanism not supported".

        To solve it, I changed my connection info to use encryption since it was required at the server.
        So I changed this:
        myConn = DriverManager.getConnection(url, myuserid, mypassword);
        to this:
        Properties properties = new Properties();
        properties.setProperty("securityMechanism",
        Integer.toString(DB2BaseDataSource.ENCRYPTED_USER_AND_PASSWORD_SECURITY));
        properties.setProperty("user","myuserid");
        properties.setProperty("password","mypassword");
        myConn = DriverManager.getConnection(url, properties);

        The format of the url did not need any changes. It was formatted like this:
        url = "jdbc:db2://my.company.com:portnumber/DBNAME"
        There are many other possible settings for "securityMechanism" so you may need to find the right one.
        Here is a link to information which was very helpful for me:
        http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.java.doc/doc/cjvjcsec.htm