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
Post a Comment