title: when i try to connect with data base mysql through jsf i get error that no diver found
body: <p>/*java class */ </p>
  
  <pre><code>package com.tutoria;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.util.Properties;
  public class dbhandler {
  Connection conn ;
  
  public dbhandler() 
  {
      conn = null;
      String userName = "root";
      String password = "1234";
      String serverName = "localhost";
      int portNumber = 3306;
  
      String dbName = "a2";
  
      try {
           conn = null;
  
          Properties connectionProps = new Properties();
          connectionProps.put("user", userName);
          connectionProps.put("password", password);
          System.out.println("trying to get connection!! :)");
          conn = DriverManager.getConnection("jdbc:mysql://" + serverName
                  + ":" + portNumber + "/" + dbName, connectionProps);
  
          System.out.println(" Connection achieved!! ");
              //conn.close();
      }
      catch (Exception e)
      {
          e.printStackTrace();
          System.out.println("Exception " +e);
      }
  
  }
  
  public boolean create_account (String table)
  {
  
      return true;
  }
  public boolean insertplayer()
  {
      return true;
  }
  public String  getid()
  {
      String a=null;
  
      String sqlquery="Select * from student "+" where id='145' ";    try{
  
      PreparedStatement Stat1=(PreparedStatement)conn.prepareStatement(sqlquery);
  
      ResultSet Rset=Stat1.executeQuery(sqlquery);
      while (Rset.next())
      {
          a=Rset.getString(2);
      }}catch (Exception e){
  System.out.println(e);}return a;
      }}
  
  
  
  
  
  
  /* xhtml*/ 
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"&gt;
  &lt;h:form&gt;
  &lt;h:panelGrid columns="2"&gt;
  &lt;h:outputText value="Name"&gt;&lt;/h:outputText&gt;
  &lt;h:inputText value="#{person.name}"&gt;&lt;/h:inputText&gt;
  &lt;h:outputText value="Password"&gt;&lt;/h:outputText&gt;
  &lt;h:inputText value="#{person.id}"&gt;&lt;/h:inputText&gt;
  &lt;h:commandButton value="Login" action="#{loginBean.idreturn}"&gt;
  &lt;/h:commandButton&gt;
  &lt;/h:panelGrid&gt;
  &lt;/h:form&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>/* i have added the jar file of connector but still it shows  no driver but 
  when i run only the java class file it retrives the result without giving any error.. if anyone knows that help me . thanks for advances ..*/</p>