Member 13467536 Ответов: 0

Как интегрировать hibernate с интерфейсом jsp


<big>here is my jsp Page code,in this page i try to call signUp.java which i  have defined in Users package,and i have test this class in src FileFolder so that means it can run on java application without any problems </big>
<pre><%@ page language="java" import="Users.*,Hibernate.*" contentType="text/html; charset=GB18030"  pageEncoding="GB18030"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>SignUp_Page</title>
</head>
<body>
<jsp:useBean id="sup" class="Users.signUp"/>
<form action="userlogin.jsp" method="post">
	<table align="center">
		<tr>
			<th>user_id</th><td><input type="text" name=uid></td>
		</tr>
		<tr>
			<th>user_name</th><td><input type="text" name="uname"></td>
		</tr>
		<tr>
			<th>user_pwd</th><td><input type="text" name="upwd"></td>
		</tr>
		<tr>
			<td><input type="submit" value="Sign up!"></td>
		</tr>
	</table>

</form>

	<%	
		String uid=request.getParameter("uid");
		String uname=request.getParameter("uname");
		String upwd=request.getParameter("upwd");

		sup.addUser(uid,uname,upwd);
	%>
</body>
</html>

//и когда я запускаю этот jspPage,вот ошибка:
Stacktrace:] with root cause
java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/mydatabase
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:421)
	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
	at Users.signUp.addUser(signUp.java:15)
	at org.apache.jsp.html.signUp_jsp._jspService(signUp_jsp.java:124)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)




Что я уже пробовал:

я поместил весь необходимый пакет в WEBINF/lib,но он все равно не работает

0 Ответов