0

I am trying to create a simple web application in J2EE. I am getting the following error:

exception:

javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get 
connection,          
DataSource invalid: "java.sql.SQLException: No suitable driver found for jdbc/qweDS"

root cause:

javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid:   
"java.sql.SQLException: No suitable driver found for jdbc/qweDS"

added thee resource, created the connection pool, checked the connection.. enabled the driver.. checked web.xml file and glassfish-resources.xml

Any idea what am I doing wrong. or where to set the driver.

Jost
  • 1,549
  • 12
  • 18
Urvah Shabbir
  • 945
  • 2
  • 15
  • 46
  • @H2CO3... what odes that mean ? :/ – Urvah Shabbir Oct 13 '13 at 20:24
  • 1
    See http://stackoverflow.com/questions/8146793/jdbc-msql-no-suitable-driver-found-for-jdbcmysql-localhost3306-mysql (All capitals is considered shouting.) – Joop Eggen Oct 13 '13 at 20:25
  • @userXXX Usually, SQL programmers who are used to write their commands in ALL CAPS, will also USE ALL CAPS IN THE TITLE LIKE THIS. It is very annoying, it is considered impolite and shouting. It's superfluous to write your title in all caps, since it's already bold and highlighted using a bigger font size, so don't do this. –  Oct 13 '13 at 20:25
  • @H2CO3... oh apologies.. i knew that but i thought it was only for emails or conversations ..not headings of a post :/ – Urvah Shabbir Oct 13 '13 at 20:30
  • thanks for the edit. who ever gave it – Urvah Shabbir Oct 13 '13 at 20:34

2 Answers2

0

You need to download a suitable JDBC driver depending on your database, then right-click on the project on Netbeans and click Add Library. After that choose the JDBC.jar file you downloaded and try again.

Joao
  • 321
  • 2
  • 6
  • i am using mysql DB.. and its driver is already there in services> drivers.. from where i selected connect using and made a database connection. – Urvah Shabbir Oct 13 '13 at 20:33
  • checked. have the driver added.. netbeans already has the jar file.. it only needs to be included.. and i have it included.. still getting the same error.. – Urvah Shabbir Oct 18 '13 at 20:38
0

You have notincluded driver jar file. According to your database you have to include driver jar file like in Mysql you have to include mysql-connector-java-(version).jar

You can download from internet

xrcwrn
  • 5,339
  • 17
  • 68
  • 129
  • i have the jar file..i dont remember exactly but i did include it some where.. where exactly can i check if its added or not.. – Urvah Shabbir Oct 18 '13 at 19:16