This comes up all the time on the expect.pm list.
Since you have AIX, put SSH on the database box, then use the expect.pm perl module to spawn an slogin to it from the linux box. Expect.pm can then handle all of the output and response stuff pretty easily. The reason I say use ssh instead of telnet is that automating telnet requires that you save an unecrypted password somewhere. This is a bad idea.

Are you suggestion that he have Expect enter the password to ssh/slogin? Were does Expect store the password? Does it store it encrypted manner? The only thing I can think of would be to use ssh Public Key Authenication and avoid having to enter a password all together thus removing the need for Expect.