-
Notifications
You must be signed in to change notification settings - Fork 28
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
Manwithhonor sqldb #220
base: master
Are you sure you want to change the base?
Manwithhonor sqldb #220
Conversation
it's a test for git_how_to task
String dataBaseName = null; | ||
int counter=0; | ||
for ( counter = 0; counter < 3; counter++){ | ||
dataBaseName = "tdb-"+Integer.toString(counter+1)+".trail5.net:"; |
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.
Лучше counter = 1; counter <= 3
append("user=track_student&"). //login | ||
append("password=7EsH.H6x"); //password | ||
listOfConnections.put( counter, DriverManager.getConnection(url.toString())); | ||
} catch ( SQLException e ) { |
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.
Можно типы исключений отловить через ИЛИ
catch ( SQLException | IllegalAccessException e) {...}
private Connection findShardInDataBase(String userName) throws IllegalArgumentException{ | ||
char firstLetterOfUsername = userName.charAt(0); | ||
try { | ||
if ( ( ('a' <= firstLetterOfUsername) && (firstLetterOfUsername <= 'j') ) || ( ('A' <= firstLetterOfUsername) && (firstLetterOfUsername <= 'J') ) ){ |
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.
проще сделать заранее Character::toLowerCase()
} | ||
}); | ||
int res=0; | ||
if (limit < listOfMessage.size()){ |
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.
res = Math.min(limit, listOfMessages.size())
} else { | ||
res= listOfMessage.size(); | ||
} | ||
return listOfMessage.subList(0, res); |
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.
return происходит из первой итерации цикла?
I have completed conversationSevice class.
Implementation into client and server class i will add later