⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read.jsp

📁 是一个自己做的在线阅读的jsp网站
💻 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 + -