try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost/phpMyAdmin/Database_Name","root","");
stmt=con.createStatement();
}
This is my code to establish a connection b/w my computer and database and after this I receive the user name and password from the user and then i execute this query
try {
rs=stmt.executeQuery("SELECT * FROM d
teacher_info WHERE UserName
= '"+userName+"' AND teacher_info.password
="+password);
}
The problem is that whenever i execute the query i get java.lang.NullPointerException 3 times in a row Any ideas as to why this could be happening ?