| 全能ASP/PHP/ASP.NET主机,支持月付 | 专业 MSSQL 数据库空间,支持月付 | 专业 MySQL 数据库空间,支持月付 | 学习型 ASP/PHP/ASP.NET 主机 30元/年 |
| 高端软件开发 = 年薪十万不是梦 | 赛孚耐:软件保护加密专家 | 身份认证令牌USB KEY |

那个文件叫什么怎么找啊
我现在有一个 不知道怎么回事就是连不上
想重新弄一个
这个驱动包.
将它放到你的web项目文件夹的lib下
如果你用的是NetBeans的话,那只是在库里添加这个jar就可以了.
[CODE]<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP</title>
</head>
<body>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tennis","root","admin");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select playerno from players");
while(rs.next()){
out.println(rs.getString(1));
}
rs.close();
stmt.close();
con.close();
}catch(Exception exc){
out.print(exc.toString());
}
%>
</body>
</html>[/CODE]
