jsp连接sql2005
在管理工具里面有数据源 选择sql数据源
在代码中:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:Ybz");
Statement stat=con.createStatement();
ResultSet rs=stat.executeQuery("select * from [case] ");
//或者
// PreparedStatement pstat=con.prepareStatement("select * from 数据库表的名称 where ID=?");
// pstat.setString(1,值);
// ResultSet rs=pstat.executeQuery();
%>
<table border="1">
<%
while(rs.next())
{
%>
<tr>
<td>
<%=rs.getString(1)%>
&n
相关文档:
USE [sfaecrm]
GO
/****** 对象: StoredProcedure [dbo].[proc_insert] 脚本日期: 05/29/2009 06:16:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[proc_insert] (@tablename varchar(256))
as
begin
set ......
测试机test安装的是windows server2008+sql server 2008,数据库安装成功。可以连接局域网内其他机器的数据库(其他机器的数据库为SQL 2005)。但是网内其他机器访问test时,无法连接,报错。信息为:在建立与服务器的连接时出错。在连接到SQL SERVER 2005时,在默认的设置下SQL SERVER 不允许进行远程连接可能会导致次失败 ......
文章来源:IT工程技术网, 全文链接:http://www.systhinker.com/html/81/n-11481.html
1.计算每个人的总成绩并排名
select name,sum(score) as allscore from stuscore group by name order by allscore
2.计算每个人的总成绩并排名
select distinct t1.name,t1.stuid,t2.allscore from stuscore t1,( select st ......
◆1.DBCC CacheStats :显示存在于当前 buffer Cache 中的对象的信息,例如 :hitrates 编译的对象和执行计划
DBCC CACHESTATS
从这个命令可以得到一些关键的统计信息:
Hit Ratio:显示特定对象可以在Sql Server的缓存中被命中的百分比,这个数值越大,越好
Object Count:显 ......