java - Why I am getting this [ClassNotFoundException com.mysql.jdbc.Driver]? -


pushing data database through jsp giving me classnotfoundexception, while parsing data main method working fine.

i have mysql-connector jar , in place,

in following class there few methods opening/closing database connections.

package com.socialhub.dao;  import java.sql.connection; import java.sql.drivermanager;  public class dbconnection {     public static int client = 0;      public static connection getconnection() {         connection con = null;         try {             class.forname("com.mysql.jdbc.driver");             con = drivermanager.getconnection("jdbc:mysql://localhost:3306/socialhub","root","root");             client++;         } catch (exception e) {             system.out.println("connection issue " + e.getmessage());             e.printstacktrace();         }         return con;     }     public void closeconnection(connection conn) {         try {             conn.close();             client--;         } catch (exception e) {             system.out.println("connection close issue" + e.getmessage());         }     }     public int getclient() {         return client;     } } 

<%@ page import="com.socialhub.action.service"%>    <%   string username=request.getparameter("uname");  string fullname=request.getparameter("fname");  string password=request.getparameter("password");  string country=request.getparameter("country");  string gender=request.getparameter("gender");    service service=new service();  string message="";  int valid=0;  try {  	country.length();  }  catch(exception e) {  	country="na";  }  if(country.equalsignorecase("na")||country.equalsignorecase("null")||country==null) {  	message="invalid username , password";  	valid=service.checkcredential(username,password);  	if(valid==0) {  		response.sendredirect("profile.jsp");  	} else {      	response.sendredirect("login.jsp?message="+message);  	}  }  else {  	valid=service.save(fullname, country, gender, username, password);  	if(valid==1) {  		message="registration completed";  		response.sendredirect("login.jsp?message="+message);   	}  	else {  		message="some server error";  		response.sendredirect("login.jsp?message="+message);   	}  }  %>


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -