page import="java.sql.*" 

String connectionURL = "jdbc:mysql://sql2.njit.edu:3306/database_name";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;



Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "username", "password");
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM tablename");

while (rs.next()) {
out.println(rs.getString("column1"));
out.println(rs.getString("column2"));
out.println(rs.getString("column3"));
}

rs.close();