求教一个入门级的jsp问题 - Java / Web 开发
我的数据库连接问题,但执行一个书上的程序时总是报错,各位大侠帮忙处理下
代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>查询系统</title>
</head>
<body>
<%
String dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver";
//获得用户的输入姓名
String studentname=new String(request.getParameter("studentname").getBytes("iso8859-1"),"GB2312");
//设置数据库的url,databasename表示数据库名称
String url="jdbc:sqlserver://localhost:1433;DatabaseName=test";
String user="sa";
String pwd="123456";
String query="select * from student where Stu_Name like '% "+studentname+" %' ";
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
//加载并注册jdbc驱动
Class.forName(dbDriver);
conn= DriverManager.getConnection(url,user,pwd);
stmt=conn.createStatement();
rs=stmt.execute
相关问答:
一个JSP页面接收其他页面提交过来的FORM表单,但是要求只接收当前站点及其子站点提交过来的FORM表单,其他站点提交过来的表单不接收,这个怎么设置?
用过滤器
filter
将当前站点及其子站点放一个目录
然 ......
我JSP的页面是:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
请我用FCK上传文件,在本地的windows机上测试可以,但部署到linux服务器上就上传不了文件,上传文件时一直卡在那里。望各位大虾指点,谢谢!
路过,帮你顶一下。。。。。。。。。。。。。。
上传文件的路径问题, ......
我写了个jsp页面,然后改动了一下,改动的内容就是在jsp页面的js函数里加了个alert()语句,但是我访问这个页面时,死活都是原来页面的内容,我加了很多alert函数还是没改动前的页面内容;tomcat重启了,也重新部署这 ......
现在不想用<a> </a> 标签 ,因为点击后会出现页面重定位,给文字加上css样式就可以看起来 是href怎么实现这样的css
text-decoration:underline; cursor:hand;
引用
text-decoration:underline; cur ......