Tuesday, 23 February 2016

How to solve DB2 "User ID revoked" ERRORCODE -4214 in Windows?

If we tried connecting to DB2 using the wrong password, the user account will be locked after the 3rd attempt and we'll receive the following error message:
Could not create connection
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:277)
........
Caused by: com.ibm.db2.jcc.am.SqlInvalidAuthorizationSpecException: [jcc][t4][2017][11253][4.14.137] Connection authorization failure occurred.  Reason: User ID revoked. ERRORCODE=-4214, SQLSTATE=28000
To unlocked the user account:
- Open Control Panel | User Accounts
- Select Manage User Accounts
- Select Advanced tab
- Click Advanced button on the Advanced user management section
- Open Users folder on the pop-up window, double-click on the DB2 user account
- Uncheck the Account is locked out option on the user properties pop-up window

Voila! We can now connect to our DB2.


Tuesday, 3 November 2015

How to access DB2 from SQLDeveloper

To be able to access DB2 from SQLDeveloper, you need a JDBC driver (db2jcc.jar - just google it).
Assuming you have downloaded the jar, here's how to setup the SQLDeveloper:
1. Open SQLDeveloper
2. Go to Tools > Preferences
3. Open Database | Third Party JDBC Drivers from the left hand side panel
4. Click 'Add Entry' button,select the jar file that you've downloaded and click 'OK'
  
5. After setup the JDBC driver, a DB2 tab will be added to the New Connection screen

Note for Enter Database field:
  • Enter <DatabaseName> if you wish to display all schema within a database
  • Enter <DatabaseName>:currentSchema=<SchemaName> if you wish to work on a specific schema within a database

Intro...

Just some random techie stuffs....