jsp企业网站源码
❶ jsp 中网站的首页源代码
这是最简单的一个例子,数据库要你自己建,用的是ACCESS
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JSP连接Access数据库</title>
<style type="text/css">
<!--
.style1 {
font-size: 20px;
font-weight: bold;
}
-->
</style>
</head><body>
<div align="center" class="style1">JSP连接Access数据库</div>
<br>
<hr>
<p><%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
Connection con = DriverManager.getConnection("jdbc:odbc:jspdata"); //建立数据库链接,jspdata为ODBC数据源名称
//建立Statement对象
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("select * from lyb"); //建立ResultSet(结果集)对象,并执行SQL语句
%>
</p>
<p align="center">NUMB1数据表中记录如下</p>
<table width="640" border="1" align="center" bordercolor="#7188e0">
<tr bgcolor="d1d1ff">
<th width="49">编号</th>
<th width="90">姓名</th>
<th width="126">E-mail</th>
<th width="221">网站</th>
<th width="80">QQ</th>
</tr>
<%
while(rs.next())
{
%>
<tr bgcolor="#f8f8f8">
<th><%= rs.getString(1) %></th>
<th><%= rs.getString(2) %></th>
<th><%= rs.getString(3) %></th>
<th bgcolor="#f6f6f8"><%= rs.getString(4) %></th>
<th><%= rs.getString(5) %></th>
</tr>
<%
}
rs.close();
stmt.close();
con.close();
%>
</table>
<p align="center"><br>
如果您能看到表格中的数据,说明连接数据库成功!</p>
</body>
</html>
❷ 跪求一份基于jsp的商城系统的源代码啊,前端和后台的完整代码,谢谢各位大神
void CALLBACK EXPORT TimerProc(HWND hWnd,UINT nMsg,UINT nTimerid,DWORD dwTime)
{
switch(nTimerid)
{
case 1:
// 处理ID为1的定时器的事件
func1();
break;
case 2:
// 处理ID为2的定时器的事件
func2();
break;
......
default:
break;
}
}
❸ jsp中网站的首页源代码
这是最简单的一个例子,数据库要你自己建,用的是ACCESS
<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"errorPage=""%>
<html>
<head>
<metancon=DriverManager.getConnection("jdbc:odbc:jspdata");//建立数据库链陆告早接,jspdata为ODBC数据源名称
//建立Statement对象
Statementstmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSetrs=stmt.executeQuery("select*fromlyb");//建立ResultSet(结果集)对象,并执行SQL语句
%>
</p>
<palign="center">NUMB1数据表中记录如友悉下</p>
<tablewidth="640"border="1"align="center"bordercolor="7188e0">
<trbgcolor="d1d1ff">
<thwidth="49">编号</th>
<thwidth="90">姓名</th>
<thwidth="126">E-mail</th>
<早雀thwidth="221">网站</th>
<thwidth="80">QQ</th>
</tr>
<%
while(rs.next())
{
%>
<trbgcolor="f8f8f8">
<th><%=rs.getString(1)%></th>
<th><%=rs.getString(2)%></th>
<th><%=rs.getString(3)%></th>
<thbgcolor="f6f6f8"><%=rs.getString(4)%></th>
<th><%=rs.getString(5)%></th>
</tr>
<%
}
rs.close();
stmt.close();
con.close();
%>
</table>
<palign="center"><br>
如果您能看到表格中的数据,说明连接数据库成功!</p>
</body>
</html>
❹ 你好,怎么用tomcat打开jsp网站源代码啊
比如Myeclipse可以直接用它自带的插件部署,一键将你web工程下对应的文件部署到tomcat服务器目录下,然后在浏览器中用localhost访问,或者自己手动部署,网上资料很多的,对应文件夹下放什么东西,放好后一样红localhost访问
❺ JSP源码的网站在本地怎么测试,用什么软件
用网页三剑客等之类的,也可以用他们专门的软件比如vb.net2005,PHP专用软件EclipsePHP Studio,等等有很多种,当然也可以用记事本之类的也行.
❻ 求JSP网站模版
不知道你具体的要什么风格的, 去以下网站 去找找 总有一款适合你!我自己一般用程序都在这里面找,
源码之家- www.mycodes.net
酷网动力 www.aspcool.com
源码联盟 www.aspsun.com
源码天下 www.pccode.net
秦岭移动 www.qinlingmobile.com