Part 3.5: Java EE Web App Tutorial - Connecting DB to the WebApp with Environment Variables

preview_player
Показать описание
The Environment variables in the tutorial works on Mac OSX, but unfortunately Windows based OS are different. It turned out that ampersand "&" breaks the string. So instead, on Windows machines, use three variable (where I have used my own MySql instance as example connection string - please substitute with your own):

-DJDBC_USER=root
-DJDBC_PASSWORD=webapp2017

In Java add:

String DB_Connection_String = DB_Url + "?user=" + DB_User + "&password=" + DB_Password;

This works on both OSX and Windows.
Рекомендации по теме
Комментарии
Автор

I believe I got an error when redeploying to AWS with the AWS DB connection settings because I was using Java 11 instead of the Java 8 AWS uses. Changing to Java 8 seems to have caused errors in the Tomcat 9 I chose to use. I believe this is probably because AWS uses Tomcat 8.5. I could be wrong about all of this since I have not been able to fix this yet.

whistlingwind
Автор

sir i cannot setup connection to rds..can i please contact you through discord

zaidev
join shbcf.ru