this is my code
public class DataBaseConnectivity {
public static void main(String args[])throws SQLException, ClassNotFoundException
{
//String url="";
//String uname="";
//String pswd="";
Class.forName("com.mysql.jdbc.Driver"); // loading and registering the driver
Connection con;
con=DriverManager.getConnection("jdbc:mysql://localhost:3306//BankAcc?autoReconnect=true&useSSL=false","root","1234");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from BankHolderDetails");
while(rs.next())
System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getString(3));
con.close();
}
}