| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1368 人关注过本帖
标题:[求助]为什么向数据库插入不了数据呢
取消只看楼主 加入收藏
binbinwu
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-5-26
收藏
 问题点数:0 回复次数:0 
[求助]为什么向数据库插入不了数据呢


<%@ page contentType="text/html;charset=gb2312" %>

<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.lang.Math.*" %>
<jsp:useBean id="conn" scope="page" class="download.conn"/>
<html>
<head>
<title>网上书店</title>
<link href="incoming/style.css" rel="stylesheet" type="text/css">
</head>
<body>

<%
String userid =request.getParameter("useid");
String password = request.Parameter("password");
String username = request.getParameter("username");
String address = request.getParameter("address");
String phone =request.getParameter("phone");
String email = request.getParameter("email");


String sql="INSERT INTO BUYERINFO
VALUES('"+userid+"','"+password+",'"+username+"','"+address+"','"+phone+"','"+email+"')";
conn.executeUpdate(sql);
%>
<br><a class="title">已经注册成功!请<a href="login.jsp">登录</a></a><br>
<%@ include file="incoming/footer.jsp"%>
</body>
</html>
小弟用上面的代码想往数据库中插入数据,可是每次都显示下面的错误:

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 13 in the jsp file: /ruanjianxiazai/adduser.jsp
Generated servlet error:
String literal is not properly closed by a double-quote


	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 13 in the jsp file: /ruanjianxiazai/adduser.jsp
Generated servlet error:
String literal is not properly closed by a double-quote


	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.


Apache Tomcat/5.5.15

希望有人能救下我,谢谢了

搜索更多相关主题的帖子: 数据库 
2006-05-26 21:05
快速回复:[求助]为什么向数据库插入不了数据呢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.034533 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved