Note: (Restricted functionality due to obvious reasons!)

For Mobile-Ease ⇓

Minimal Code ( Raw-View ) :
import java.sql.*; class JDBCApp { public static void main(String zee[]) { try { Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql:///bhsb","root",""); // try changing /// to // System.out.println("Connection Established..!"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("Select * from department"); while(rs.next()) { System.out.println(rs.getString("dname")); System.out.println(rs.getString("did")); System.out.println(rs.getString("superid")); } rs.close(); stmt.close(); conn.close(); } catch(Exception e) { System.out.println("\n"+e); } } }