Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12231

ResultSet cursor to move to specific position or one step upward in row

$
0
0

i want to check if the username given by user is my database (Mysql workbench) or not thus i wrote the method like

    {        while(rs.next())        {            if(rs.getString(1).equals(username))            {                System.out.println("already exsist");                System.out.println("Please enter another name:");                username = s.nextLine();                checkUsernameExist(rs,username);            }        }    }```i recursively called the same method until i get a unique name from the user. My problem is when i call the method 'checkUsernameExist' the parameter rs wants to be re-initialized or move one step upward in the table. What should i do now?& This is what i gotEnter the username: namealready exsistPlease enter another name:namealready exsistPlease enter another name:namei want to continue my loop until i get a unique name

Viewing all articles
Browse latest Browse all 12231

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>