I also encountered the same error when installing NW 7.4 on Windows 2008 R2 with SQL 2008 SP3. I looked at the following notes to resolve the issue:
1788188 - Couldn't connect to DB during java install
Resolve was found in note: 1788188 - Couldn't connect to DB during java install
"In addition, the issue described in this note has been observed when SAPinst is
started with <sapsid>adm user, which is not supported."
I uninstalled NW 7.4, created a local account, made it a local administrator, added it to SQL and gave it sysadmin permission.
Logged into the server using the new account and was able to complete the installation of NW 7.4 error free.
Hope this helps anyone who is facing similar issue.