How to connect to database db2 through Unix Shell Script

I am trying to connect to database db2 through shell script.

The process I am trying is

> db2
It gives me error Access Denied.
While checking for access I have the rights.

Is there ant other way round..?
Please help.

db2 connect to dbname user uname using pword

dbname: database name
uname : user name
pword : password

db2 +c -tv "SQL COMMAND"

can u please elaborate as the same problem persists..

what you checked to know you have permission ??
make sure from where you are executing the command is in the path or else look where db2 executable is ? if it would run it should ask user id and password
means db2 command is not executing please use the find command to look for db2
and then try.
i won't have any problem executing db2 from my unix machine.