Question

I'm unable to connect to db2 server using db2cmd command

db2 connect to mydb user myuser using password

Getting the following message

SQL8002N An attempt to connect to a host failed due to a missing DB2 Connect product or invalid license. SQLSTATE=42968

But I have successfully connected to this database using jdbc and I can view the structure.

Has anybody experienced such issue?

Was it helpful?

Solution

Are you trying to connect to a iSeries o z/390? or just a LUW (Linux, Unix Windows?)

If you are trying to connect to one of the two first, you need a DB2 Connect license, because they use the DRDA architecture, and it uses a special license.

Check the license

db2licm -a

If you are trying to connect to a LUW, you do not need any DB2 connect license, but probably there is a problem in you cataloged databases. Check the

db2 list node diretory
db2 list db directory

Is the database a remote server or is it a local connection?

Also, try to attach to the remote instance, in order to check that the node catalog is right

db2 attach to remoteInstance

OTHER TIPS

As the error message says, you need DB2 Connect to serve as a gateway for CLI connections. The JDBC driver does not need the gateway, as it implements the required protocol.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top