-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added SQL code along with connection utility #23
Conversation
Added SQLConnectionCredentials Added InvalidPropFileException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
explain what is this later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems fine to me, we can move ahead with this.
Currently you have put your database credentials in the code That is not appropriate in an application. So instead, you will put these credentials in a file called and then use the something on these lines import com.hsbc.meets.util.SQLConnectionCredentials;
public class SomeDaoImpl{
public SomeDaoImpl(){
try{
SQLConnectionCredentials creds = SQLConnectionCredentials.readCredentials();
String driverName = creds.getDriverName();
String username = creds.getUsername();
String password = creds.getPassword();
String url = creds.getUrl();
}catch(InvalidPropFileException e){
/*
Your error handling
*/
}
/*
Add your connection estabilishment code here
/*
}
} |
got it thank u |
sql/create_tables.sql
Outdated
@@ -1,3 +1,6 @@ | |||
CFEATE database projectdatabase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should name our database something more appropriate to the project
Now we dont need the amenity ID when we insert amenities
As this query deletes all the amenities, it should reset the perhourcost as well
To get meeting room from ID
Resolves #35
Sorry, forgot to add this earlier
@muskansingh11 Check this out
With reference to #22
Queries added
Authors: @Rashmikareddya @sushmadammalapati
SQLCredentialsUtil
Author : @TheForeverLost
com.hsbc.meets.util.SQLCredentialsUtil
This class reads MySQL database credentials stored at
src/main/webapp/WEB_INF/connection.prop
. I have added to gitignore the connection.prop file so that no one pushes it because it has credentials so security issues annd it may not be the same for all of us as we are all going to be using local database.So you'll all have to create connnection.prop files in the location specified and use this class to retrieve the properties. Till you merge with this branch, you can use store the properties in the code itself
Below is a sample
connection.prop
fileAlso created is a
InvalidPropFileException
which is thrown whenever the properties could not be read properly