Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day everyone, I have been watching this video series as a guide line for my own netbeans e commerce project but at 27:00 the teacher test the data source but when I try to run the file one I got this error message. “jakarta.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for jdbc/OkStore2"” I’m on windows 11. The program versions I’m using are Apache Netbeans IDE 16, MySQL WorkBench 8.0 CE, Eclipse GlassFish 6.2.5 (build 6.x-b66-g0159b68 2022-02-12T17:39:59+0000). My driver is mysql-connector-j-8.0.31.

Here's the error message

 Here's my TestDatasource code
<%@taglib prefix="c" uri=""%>
<%@taglib prefix="sql" uri=""%>
    Document   : testDataSource
    Created on : Jan 6, 2023, 1:01:57 AM
    Author     : Bredy

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <h1>Hello World!</h1>
        <sql:query var="result" dataSource="jdbc/OkStore2">
            SELECT * FROM category.product
            WHERE = product.category_id

        <table border="1">
            <!-- column headers -->
                <c:forEach var="columnName" items="${result.columnNames}">
                    <th><c:out value="${columnName}"/></th>
            <!-- column data -->
            <c:forEach var="row" items="${result.rowsByIndex}">
                    <c:forEach var="column" items="${row}">
                        <td><c:out value="${column}"/></td>

What I have tried:

I tried moving mysql-connector-j-8.0.31 into different folders but that didn't work.
Updated 6-Jan-23 18:56pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900