I'm trying to get the equivalent for this code on MySQL
try(Connection c = DriverManager.getConnection("jdbc:oracle:thin:@myhost:1521:"+ vardbserver, vardbuser, vardbpassword);
PreparedStatement stmts = c.prepareStatement("SELECT * FROM "+ vardbname +" where ROWNUM > ? and ROWNUM < ? ");
PreparedStatement max = c.prepareStatement("select max(ROWNUM) as txid from "+ vardbname)
)
I've looking for the sample but i got a dead end.