hi ! i ve just started doing mysql.
i am making a web application in which employees database is reqiured to be shown in the table.

i ve made a database name "educrm" and table name is "info", which i ve done in mysql through xampp(phpMyAdmin).

i am showing u the page in which code is written.

but it is showing me lots of error like full of page...

plz help me regarding this.

<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" import=”java.io.*” errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@page contentType=”text/html” pageEncoding=”UTF-8″%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
     user="root"  password=""/>

<sql:query dataSource="${snapshot}" var="result">
SELECT * from info;

<table border="1" width="100%">
   <th>Mobile no</th>
   <th>Email Add</th>
   <th>lead source</th>
   <th>preferred college</th>
   <th>Lead status</th>
<c:forEach var="row" items="${result.rows}">
   <td><c:out value="${row.name}"/></td>
   <td><c:out value="${row.mobile no}"/></td>
   <td><c:out value="${row.Email Add}"/></td>
   <td><c:out value="${row.lead source}"/></td>
   <td><c:out value="${row.preferred college}"/></td>
   <td><c:out value="${row.Qualification}"/></td>
   <td><c:out value="${row.Lead status}"/></td>
   <td><c:out value="${row.street}"/></td>
3 Years
Discussion Span
Last Post by Sudhanshu_2

it's showing you "lots of error".
do you see where that doesn't tell us very much?

before you even consider to start using a db, learn to use servlets, meaning, remove every single line of java code out of that jsp file.

also: check this line:

import="java.sql.*" import=â€java.io.*â€

if you copy pasted it, they should give the same result. so might be you have an invalid char on the second of those imports.

how to connect to a db? exactly the same way as you do in a standalone desktop app. so, do you know how to use jdbc/hibernate/jpa?


thanks for the reply first.

this is basically the problem. I ve no experience in establishing the connectivity to mysql. and i ve never used any one of the framework as well. Trying to learn about it on internet and found no great help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.