• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error: No suitable driver found

 
Gerald Leonard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, I have tried to complie my index.jsp page(which is the login Page) but I get an error
"java.sql.SQLException: No suitable driver found for jdbc:msql//localhost/jsmsbase"
though I have added a mysql-connector- 5.1.25-bin.jar file in my library and
I have no line with error(s). Am using netbeansIDE 8.0.2. Pliz can any one help how to fix this....?!
Thanks.
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The connection string for MySQL is:
jdbc:mysql://<host>/<database>
 
Gerald Leonard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oooh awesome Dave Tolls , the error has bin fixed am a bigginer in jsp. I encounter another error:
"com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'jsmsbase'."
Am using mysql in XAMPP where I havent assigned any password or username...
please help;Thanks in advance...
 
Paul Clapham
Sheriff
Posts: 21583
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gerald Leonard wrote: "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'jsmsbase'."
Am using mysql in XAMPP where I havent assigned any password or username...


Then you should go to your MySQL server and assign a user namd and a password.

Also, this question is about MySQL and not JSP so I'll move it out of the JSP forum. And if you're writing JSP code with Java scriptlets which try to access your MySQL database, you shouldn't be doing that. Java scriptlets have been obsolete for over a decade; if you're reading something which tells you to do that then you're reading out-of-date information and if you're taking a course which tells you to do that then... well, it's unfortunate you got stuck taking that course.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic