سؤال

Scenario: I have a java application which interacts with DB2 database deployed on Linux. The java application is used for basic Extract, Transform and Load operations. We connect to the database using jdbc type-4 driver having the URL :

jdbc:db2://<hostname>:<port>/<databaseName>

Problem: The above approach requires username and password but in our client environment the DB2 database is based on Unix authentication and doesn't require username and password. The UNIX user does not have a password.

Is it possible to access this database with the java application which runs on a different machine? Any sample JDBC code to accomplish this will be appreciated.

If it is not possible to access the database without password then how can we configure the database to have a password?

هل كانت مفيدة؟

المحلول 2

I am able to connect to the database using JDBC.

Reference :

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/cjvjcsup.htm

We need to specify security mechanism while creating the JDBC connection.

نصائح أخرى

1) You can connect to the database without password, if you configure the database with a authentication method as client.

For more information:

2) If you cannot change the configuration properties, you should know authentication method is configured in DB2. By default, the authentication is based on the OS, that means you just have to assign a password to the user. For example in AIX (UNIX) you type 'passwd'

If the authentication method is other, you shuold use the change password mechanism of the other mechanism. Remember that DB2 relies on an external security mechanism, DB2 does not performs the authentication, but authorization.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top