?? read.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'read.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style>
<!--
.eng { font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 10px}
-->
</style>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url ="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bookshop";
Connection conn = DriverManager.getConnection(url, "sa", "123");
String bookname=String.valueOf(session.getAttribute("BookName"));
Statement st =conn.createStatement();
ResultSet rs=st.executeQuery("select * from book where bookname ='"+session.getAttribute("Bookname")+"'");
String bookpath="";
if(rs.next())
{
bookpath=rs.getString("bookpath");
}
%>
<table border="0">
<td>
<p style="margin-top: -27px; margin-bottom: 0">
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" id="Pdf1" width="730" height="606">
<param name="_Version" value="327680">
<param name="_ExtentX" value="2646">
<param name="_ExtentY" value="1323">
<param name="_StockProps" value="0">
<param name="SRC" value="<%=bookpath %>">
</object>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -