java - What might be wrong with this JSP -


      conn = drivermanager.getconnection(         "jdbc:mysql://localhost:3306/ebookshop", "root", ""); 

xampp hosting mysql on 3306 linked mysql connect jar ebookshop name of db

http://i.imgur.com/9xjjlix.png

i have user root wit no password

but getting

    java.sql.sqlexception: no suitable driver found jdbc:mysql://localhost:3306/ebookshop      ... 

i have run other jsp , works, have print statement before conn statement , prints, 1 after not.

thank you

try code :-

  try     {            class.forname("com.mysql.jdbc.driver").newinstance();     }     catch (exception e)     {         system.out.println("error in data base driver:"+e);     }     try      {                            string url="jdbc:mysql://localhost:3306/ebookshop", "root", "";          connection=drivermanager.getconnection(url,username,pass);      }     catch (exception e)      {                     system.out.println("error in database connection:"+e);       } 

first register driver. can use url.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -