Skip to content
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

This 'while' statement doesn't loop #29

Open
HelgeStenstrom opened this issue Jun 22, 2019 · 8 comments
Open

This 'while' statement doesn't loop #29

HelgeStenstrom opened this issue Jun 22, 2019 · 8 comments

Comments

@HelgeStenstrom
Copy link
Contributor

while (resultSet.next()) {
exists = true;
break;
}

This 'while' statement doesn't loop. Does it work as intended? Can it be replaces with an if() structure instead?

@goxr3plus
Copy link
Owner

Yeah, it checks if the entry exists in the database that means if resultset has at least one element, i think it can be replaced with an if statement :)

@goxr3plus
Copy link
Owner

goxr3plus commented Jun 23, 2019

Good catch, you are doing amazing work i am impressed.

@goxr3plus
Copy link
Owner

@goxr3plus
Copy link
Owner

@HelgeStenstrom How you can do that ? Sending me a link with the exact line of the file in github like you did ?

I don't know how to do it ... can you show me ?

@goxr3plus
Copy link
Owner

@HelgeStenstrom
Copy link
Contributor Author

Most of my findings are from IntelliJ’s code analysis.

@goxr3plus
Copy link
Owner

goxr3plus commented Jul 2, 2019

Would you like to solve this issue here is a solution?

https://javarevisited.blogspot.com/2016/10/how-to-check-if-resultset-is-empty-in-Java-JDBC.html

IT'S easy for me but in case you want to give it a try :)

@HelgeStenstrom
Copy link
Contributor Author

I probably can’t do any coding until August. I leave this to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants