-3

I am using DB2 Express C 9.7.4.

I have to create connection with DB2 database using JAVA. Before making connection i have to validate DB2 user/password.

Please suggest any DB2 command or any other alternative

Thanks in advance

1
  • Why do you have to validate user/password before connecting? These are validated on connection. Check any JDBC exception for login failure instead!
    – DagR
    Dec 6, 2011 at 9:08

1 Answer 1

0

You could do an attach to the instance with the user's credentials. If the user belongs to sysadm, sysctrl, sysmaint or sysmon authorities (group), the user is "validated". Then, with these credentials the database could be created, but the user has to belong to sysadm or sysctrl.

For more information: Create database http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0001941.html (See "Usage notes") Attach command http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0002010.html

Do not use "db2icrt" because this command is to create an instance, and you should probably already has one.

Same question in DeveloperWorks

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.