求教一个入门级的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
相关问答:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
insert into [ScholarshipManagement].[dbo].[department] ([department],[specialization] ,[grade]) output inserted.departmentID values(? ,? ,? )
请问大哥们这个sql 语句应该用Java里的那个数据库操作方法? ......
现在不想用<a> </a> 标签 ,因为点击后会出现页面重定位,给文字加上css样式就可以看起来 是href怎么实现这样的css
text-decoration:underline; cursor:hand;
引用
text-decoration:underline; cur ......