Posts

Showing posts from December, 2020

Java Console App with AWS and JDBC as a database connector

Image
Last week was very intense and full of new learnings. I had created a simple console bank application using Java. All my data stored in the cloud, and I used AWS. AWS database connected to Java through JDBC. It is the first time I use a cloud database in my Java application. It means that not all things run smoothly at first. In this post, I will discuss the problems I run into and their possible solutions. Problem 1.  Did you know that to run any app that has a connection to the database needs an environmental variable set up? And this has to be done for every class that has a main method.  Users can put this variable in the ConnectionFactory file and do not worry about the setting environmental variable, but one can ask how safe it is. This move is not safe if we need to store this program on Github. When I set up the remote database, I have to indicate URL, USER, and PASSWORD in the connection factory. Once the file is pushed to GitHub there is a sensitive information leak. It means