bash$ . /home/db2inst1/sqllib/db2profile
bash$ db2 CATALOG TCPIP NODE derby REMOTE localhost SERVER 1527
bash$ db2 CATALOG DATABASE MYDB AT NODE derby AUTHENTICATION SERVER
bash$ db2 CONNECT TO MYDB USER username USING password
With any luck, Apache Derby will accept the connection successfully.