jsp jdbc连接sqlserver 2000 出现问题
代码:
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con= DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=shop", "sa", "123");
sql=con.createStatement();
String s="'"+logname+"'"+","+"'"+realname+"'"+","+"'"+password+"'"+","+"'"+email+"'"+","+"'"+phone+"'"+","+"'"+address+"'";
String condition="insert into user values"+"("+s+")";
sql.executeUpdate(condition);
message="注册成功了";
con.close();
}
catch(Exception e){
e.printStackTrace();
}
错误提示:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]在关键字 'user' 附近有语法错误。
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces
相关问答:
一个静态的html页面,美化,界面布局已经处理好了 ,在编写程序的时候需要在转化成JSP页面,
所以新建一个JSP页面,讲原来的代码拷贝到里面去,结果布局变了?
不存在路径问题!
没人? 真失败!
......
我是用STRUTS ,做了一个JSP页面,提交后没有存入数据库。
JSP代码如下:
aa.jsp代码
<%@ page contentType="text/html;charset=gb2312" language="java"%>
<%@ taglib uri=" ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
本人做了一个模拟购物网站,遇到一些问题。
第一个用户选择了A、B、C商品
然后第二个用户只选择D商品。
点击查看的时候,购物车列出A、B、C、D四种商品,请问哪里出了问题?
Java code:
<%@ page content ......