Press "Enter" to skip to content

Connection code of online exam system

To connect with database first install the xampp then create the database and table according to me.

Code of connection with database.

public class Connect {
Connection con = null;

public static Connection dbConnect(){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/exam", "root","");
return con;
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
return null;
}
}

}

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *