●jsp連接MySQL數據庫
testmysql
<%@ page contentType="text/html;charset=gb
<%@ page import="java
<html>
<body>
<%Class
String url ="jdbc:mysql://localhost/softforum?user=soft&password=soft
//testDB為你的數據庫名
Connection conn= DriverManager
Statement stmt=conn
String sql="select * from test";
ResultSet rs=stmt
while(rs
您的第一個字段內容為
您的第二個字段內容為
<%}%>
<%out
<%rs
stmt
conn
%>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19881.html