I have some codes line as
Class.forName("com.mysql.cj.jdbc.Driver");
connect = DriverManager
.getConnection("jdbc:mysql://localhost/"+Contant.DB_NAME+"?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&"
+ "user="+Contant.MYSQL_USER+"&password="+Contant.MYSQL_PASS);
statement = connect.createStatement();
preparedStatement = connect.prepareStatement("select * from history where status = 0");
re = preparedStatement.executeQuery();
while (re.next()) {
System.out.print("uid__"+re.getString("uid"));
}
In my database, I have 2 rows that meet the condition status = 0
.
When executing System.out.print("uid__"+re.getString("uid"));
it only shows one row. What am I doing wrong?