您好,欢迎来到智榕旅游。
搜索
您的当前位置:首页图书管理系统JSP实现(NETBEANS)

图书管理系统JSP实现(NETBEANS)

来源:智榕旅游
AddBook.jsp

<%--

Document : addBook02

Created on : 2013-12-10, 11:13:09 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\"

import=\"java.sql.*,bms_bean.*,javax.ws.rs.core.Response,java.util.Arrays\"%> <%@include file=\"include.jsp\" %>

<%! //添加图书

String addBookSql = \"INSERT INTO books (book_name, price,author_hobby,author_sex,type_id) VALUES (?,?,?,?,?,?,?)\";

public void addBook(Book book) { Connection conn = null;

PreparedStatement prep = null; try {

conn = getConnection();

prep = conn.prepareStatement(addBookSql); prep.setString(1, book.getBookName()); prep.setString(2, book.getIsbn()); prep.setString(3, book.getAuthor()); prep.setFloat(4, book.getPrice());

prep.setString(5, book.getAuthorHobby()); prep.setString(6, book.getAuthorSex()); prep.setInt(7, book.getBookType().getId()); prep.executeUpdate(); } catch (SQLException ex) { ex.printStackTrace();

} catch (ClassNotFoundException ex) { ex.printStackTrace(); } finally { try {

if (prep != null) { prep.close(); }

closeConnection();

} catch (SQLException ex) { ex.printStackTrace(); } } } %>

isbn,

author,

<%

request.setCharacterEncoding(\"utf-8\"); Book book = new Book();

BookType bookType = new BookType();

book.setBookName(request.getParameter(\"bookName\")); book.setAuthor(request.getParameter(\"author\")); book.setIsbn(request.getParameter(\"isbn\"));

book.setPrice(Float.parseFloat(request.getParameter(\"price\")));

//爱好的添加

String[] hobbyRel = request.getParameterValues(\"authorHobby\"); StringBuffer authorHobbySB = new StringBuffer();

String[] hobbyArr = {\"java\旅游\上网\看书\睡觉\钓鱼\吃货\跳舞\美术\唱歌\

for (int i = 0; i < hobbyArr.length; i++) { String str = hobbyArr[i]; boolean flag = false;

for (int j = 0; j < hobbyRel.length; j++) { if (str.equals(hobbyRel[j])) {

flag = true;//说明有这项爱好 break; } }

if (flag) {

authorHobbySB.append(\"1\"); } else {

authorHobbySB.append(\"0\"); } }

book.setAuthorHobby(authorHobbySB.toString());

book.setAuthorSex(request.getParameter(\"authorSex\"));

bookType.setId(Integer.parseInt(request.getParameter(\"typeId\"))); book.setBookType(bookType); addBook(book);

response.setCharacterEncoding(\"utf-8\"); out.print(true); %>

addBookForm.jsp

<%--

Document : addBook

Created on : 2013-12-10, 10:00:38

Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\"%>

添加图书

添加图书

书名:

类型:

ISBN:

价格:

作者:

性别:

爱好:

  • java
  • 旅游
  • 上网
  • 看书
  • 睡觉
  • 钓鱼
  • 吃货
  • 跳舞
  • 美术
  • 唱歌

addValidateISBN.jsp

<%--

Document : validateIsbn

Created on : 2013-12-18, 9:00:45 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\" import=\"java.sql.*,java.io.PrintWriter\"%> <%@include file=\"include.jsp\"%> <%! //验证isbn

String validateIsbnSql = \"select * from books where isbn=?\";

public boolean validateIsbn(String isbn) { Connection conn = null;

PreparedStatement prep = null; ResultSet rst = null; try {

conn = getConnection();

prep = conn.prepareStatement(validateIsbnSql); prep.setString(1, isbn); rst = prep.executeQuery(); if (rst.next()) { return true; } else {

return false; }

} catch (ClassNotFoundException e) {

e.printStackTrace();

System.out.println(\"驱动加载失败\"); return true;

} catch (SQLException ex) { ex.printStackTrace();

System.out.println(\"数据库查询失败\"); return true; } finally { try {

if (rst != null) { rst.close(); }

if (prep != null) { prep.close(); }

closeConnection();

} catch (SQLException ex) { ex.printStackTrace();

System.out.println(\"数据库关闭异常\"); return true; } } } %> <%

request.setCharacterEncoding(\"utf-8\"); response.setCharacterEncoding(\"utf-8\"); String isbn = request.getParameter(\"isbn\"); PrintWriter pw = response.getWriter(); pw.print(validateIsbn(isbn)); %>

Book_type.jsp

<%--

Document : book_type

Created on : 2013-12-27, 10:13:40 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"UTF-8\" errorPage=\"error.jsp\" import=\"net.sf.json.JSONArray,bms_bean.BookType,java.util.*,java.sql.*\"%> <%@include file=\"include.jsp\"%>

<%!

//查找到所有的书籍类型

String findBookTypeSql = \"select * from book_type\";

public List findAllBookType() {

List bookTypes = new ArrayList(); Connection conn = null;

PreparedStatement prep = null; ResultSet rst = null; try {

conn = getConnection();

prep = conn.prepareStatement(findBookTypeSql); rst = prep.executeQuery(); BookType bookType = null; while (rst.next()) {

bookType = new BookType(); bookType.setId(rst.getInt(\"id\"));

bookType.setTypeName(rst.getString(\"type_name\")); bookTypes.add(bookType); }

} catch (ClassNotFoundException e) { e.printStackTrace(); return null;

} catch (SQLException ex) { ex.printStackTrace(); return null; } finally { try {

if (rst != null) { rst.close(); }

if (prep != null) { prep.close(); }

closeConnection();

} catch (SQLException ex) { ex.printStackTrace(); return null; } }

return bookTypes; } %> <%

JSONArray bookTypeArr = JSONArray.fromObject(findAllBookType()); out.print(bookTypeArr.toString()); %>

Books_list.jsp

<%--

Document : books_list

Created on : 2013-12-23, 17:01:49 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\"

import=\"java.sql.*,java.util.*,bms_bean.*,com.sun.crypto.provider.RSACipher,net.sf.json.JSONArray\"%>

<%@include file=\"include.jsp\"%> <%! int pageSize = 10;

//根据条件动态构建查询到总页数的SQL语句

public String createPageCountSql(String bookName, String isbn, String author, Float price, Integer typeId, List params) { StringBuffer sb = new StringBuffer();

sb.append(\"select count(*) from books where 1 \"); if (!(bookName == null || bookName.equals(\"\"))) { sb.append(\" and book_name=?\"); params.add(bookName); }

if (!(isbn == null || isbn.equals(\"\"))) { sb.append(\" and isbn=?\"); params.add(isbn); }

if (!(author == null || author.equals(\"\"))) { sb.append(\" and author=?\"); params.add(author); }

if (price != null) {

sb.append(\" and price=?\"); params.add(price); }

if (typeId != null) {

sb.append(\" and type_id=?\");

params.add(typeId); }

return sb.toString(); }

//创建根据条件查询到相关记录的SQL

public String createFindBooksSql(int index, String bookName, String isbn, String author, Float price, Integer typeId, List params) { StringBuffer sb = new StringBuffer();

sb.append(\"select * from books join book_type on book_type.id=books.type_id where 1 \"); if (!(bookName == null || bookName.equals(\"\"))) { sb.append(\" and book_name=?\"); params.add(bookName); }

if (!(isbn == null || isbn.equals(\"\"))) { sb.append(\" and isbn=?\"); params.add(isbn); }

if (!(author == null || author.equals(\"\"))) { sb.append(\" and author=?\"); params.add(author); }

if (price != null) {

sb.append(\" and price=?\"); params.add(price); }

if (typeId != null) {

sb.append(\" and type_id=?\"); params.add(typeId); }

sb.append(\" order by books.id desc limit ?,?\"); return sb.toString(); }

//根据条件查询到总页数

public int findPageCountByCondition(int index, String bookName, String isbn, String author, Float price, Integer typeId, List params) { int pageCount = 0; //总页数 Connection conn = null;

PreparedStatement prep = null; ResultSet rst = null; try {

conn = getConnection();

params = new ArrayList(); //用来存储条件查询时的各种条件值,便于prep

赋值的时候使用

String sql = createPageCountSql(bookName, isbn, author, price, typeId, params); prep = conn.prepareStatement(sql); for (int i = 0; i < params.size(); i++) { prep.setObject(i + 1, params.get(i)); }

rst = prep.executeQuery(); rst.next();

int recordCount = rst.getInt(1);//得到记录总数 if (recordCount % pageSize == 0) {

pageCount = recordCount / pageSize; } else {

pageCount = recordCount / pageSize + 1; }

} catch (ClassNotFoundException e) { e.printStackTrace(); return 0;

} catch (SQLException ex) { ex.printStackTrace(); return 0; } finally { try {

if (rst != null) { rst.close(); }

if (prep != null) { prep.close(); }

closeConnection();

} catch (SQLException ex) { ex.printStackTrace();

System.out.println(\"数据库关闭异常\"); return 0; } }

return pageCount; }

//根据查询条件找到相应的记录集

public List findBooksByCondition(int index, String bookName, String isbn, String author, Float price, Integer typeId, List params) { List books = new ArrayList(); Connection conn = null;

PreparedStatement prep = null;

ResultSet rst = null; try {

conn = getConnection();

params = new ArrayList(); //用来存储条件查询时的各种条件值,便于prep赋值的时候使用

String sql = createFindBooksSql(index, bookName, isbn, author, price, typeId, params); prep = conn.prepareStatement(sql); for (int i = 0; i < params.size(); i++) { prep.setObject(i + 1, params.get(i)); }

prep.setInt(params.size() + 1, pageSize * (index - 1)); prep.setInt(params.size() + 2, pageSize); rst = prep.executeQuery(); Book book = null;

BookType bookType = null; while (rst.next()) { book = new Book();

bookType = new BookType(); book.setId(rst.getInt(\"id\"));

book.setBookName(rst.getString(\"book_name\")); book.setIsbn(rst.getString(\"isbn\"));

book.setAuthor(rst.getString(\"author\")); book.setPrice(rst.getFloat(\"price\"));

bookType.setTypeName(rst.getString(\"type_name\")); book.setBookType(bookType);

if (rst.getString(\"author_sex\").trim().equals(\"1\")) { book.setAuthorSex(\"男\");

} else if (rst.getString(\"author_sex\").trim().equals(\"0\")) { book.setAuthorSex(\"女\"); } else {

book.setAuthorSex(\"未知\"); }

StringBuffer authorHobbySB = new StringBuffer();

String[] hobbyArr = {\"java\旅游\上网\看书\睡觉\钓鱼\吃货\跳舞\美术\唱歌\

char[] authorHobbyArr = rst.getString(\"author_hobby\").trim().toCharArray(); for (int i = 0; i < authorHobbyArr.length; i++) { if (authorHobbyArr[i] == '1') {

authorHobbySB.append(hobbyArr[i] + \"|\"); } }

book.setAuthorHobby(authorHobbySB.toString()); books.add(book); }

} catch (ClassNotFoundException e) { e.printStackTrace(); return null;

} catch (SQLException ex) { ex.printStackTrace(); return null; } finally { try {

if (rst != null) { rst.close(); }

if (prep != null) { prep.close(); }

closeConnection();

} catch (SQLException ex) { ex.printStackTrace(); return null; } }

return books; } %> <%

request.setCharacterEncoding(\"utf-8\"); response.setCharacterEncoding(\"utf-8\"); int index = 1;

if (request.getParameter(\"index\") == null || request.getParameter(\"index\").equals(\"\")) { index = 1; } else {

index = Integer.parseInt(request.getParameter(\"index\").trim()); }

String bookName = request.getParameter(\"bookName\").trim(); String isbn = request.getParameter(\"isbn\").trim();

String author = request.getParameter(\"author\").trim(); Float price = null; if (request.getParameter(\"price\").trim() == null request.getParameter(\"price\").trim().equals(\"\")) { price = null; } else {

price = Float.parseFloat(request.getParameter(\"price\")); }

Integer typeId = null; if (request.getParameter(\"typeId\").trim() == null

||

||

request.getParameter(\"typeId\").trim().equals(\"\")) { price = null; } else {

typeId = Integer.parseInt(request.getParameter(\"typeId\")); }

List params = new ArrayList();

int pageCount = findPageCountByCondition(index, bookName, isbn, author, price, typeId, params);

List books = findBooksByCondition(index, bookName, isbn, author, price, typeId, params);

JSONArray array = JSONArray.fromObject(books); array.add(books.size(), index);

array.add(books.size() + 1, pageCount); out.print(array.toString()); %>

booksListForm.jsp <%--

Document : BooksList

Created on : 2013-12-10, 8:57:41 Author : new

--%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\"%> <%@include file=\"include.jsp\"%>

图书列表

图书管理系统

select\").append(\"

书名:
ISBN:
价格:
作者:
类型:

书名 类型 ISBN 价格 作者 性别 爱好 操作


deleteBook.jsp

<%--

Document : deleteBook

Created on : 2013-12-10, 15:28:36 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"UTF-8\" errorPage=\"error.jsp\" import=\"java.sql.*\"%> <%@include file=\"include.jsp\"%> <%! //删除图书

String deleteBookSql = \"delete from books where id=?\";

public void deleteBook(int id) throws SQLException, ClassNotFoundException { Connection conn = getConnection(); PreparedStatement prep = null; try {

prep = conn.prepareStatement(deleteBookSql); prep.setInt(1, id);

prep.executeUpdate(); } catch (SQLException ex) { ex.printStackTrace(); } finally { try {

prep.close();

} catch (SQLException ex) { ex.printStackTrace(); }

closeConnection(); } } %> <%

request.setCharacterEncoding(\"utf-8\"); response.setCharacterEncoding(\"utf-8\");

if (request.getParameter(\"id\") == null || request.getParameter(\"id\").equals(\"\")) { out.print(false); } else {

int id = Integer.parseInt(request.getParameter(\"id\")); try {

deleteBook(id); out.print(true);

} catch (ClassNotFoundException e) {

out.print(false);

} catch (SQLException e) { out.print(false); } } %>

Include.jsp

<%--

Document : include

Created on : 2013-12-11, 9:25:30 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\" import=\"java.sql.*\"%>

<%! ThreadLocal connHolders = new ThreadLocal(); //数据库的连接

public Connection getConnection() throws SQLException, ClassNotFoundException { Connection conn = connHolders.get(); if (conn == null) {

Class.forName(\"com.mysql.jdbc.Driver\"); conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/book?useUnicode=true&characterEncoding=utf-8\ connHolders.set(conn); }

return conn; }

//数据库的关闭

public void closeConnection() throws SQLException { Connection conn = connHolders.get(); if (conn != null) { conn.close();

connHolders.set(null); } } %>

modifyBook.jsp

<%--

Document : modifyBook02 Created on : 2013-12-10, 11:51:11 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\" import=\"java.sql.*,bms_bean.*\"%> <%@include file=\"include.jsp\"%>

<%! //修改记录 String modifyBookSql = \"update books set book_name=?,isbn=?,author=?,price=?,author_hobby=?,author_sex=?,type_id=? where id=?\";

public void modifyBook(Book book) throws SQLException, ClassNotFoundException { Connection conn = getConnection(); PreparedStatement prep = null; try {

prep = conn.prepareStatement(modifyBookSql); prep.setString(1, book.getBookName()); prep.setString(2, book.getIsbn()); prep.setString(3, book.getAuthor()); prep.setFloat(4, book.getPrice());

prep.setString(5, book.getAuthorHobby()); prep.setString(6, book.getAuthorSex()); prep.setInt(7, book.getBookType().getId()); prep.setInt(8, book.getId()); prep.executeUpdate(); } catch (SQLException ex) { ex.printStackTrace(); } finally { try {

prep.close();

} catch (SQLException ex) { ex.printStackTrace(); }

closeConnection(); } } %> <%

request.setCharacterEncoding(\"utf-8\"); response.setCharacterEncoding(\"utf-8\"); Book book = new Book();

BookType bookType = new BookType();

book.setId(Integer.parseInt(request.getParameter(\"id\"))); book.setBookName(request.getParameter(\"bookName\")); book.setIsbn(request.getParameter(\"isbn\"));

book.setAuthor(request.getParameter(\"author\"));

book.setPrice(Float.parseFloat(request.getParameter(\"price\"))); //爱好的更新

String[] hobbyRel = request.getParameterValues(\"authorHobby\"); StringBuffer authorHobbySB = new StringBuffer();

String[] hobbyArr = {\"java\旅游\上网\看书\睡觉\钓鱼\吃货\跳舞\美术\唱歌\

for (int i = 0; i < hobbyArr.length; i++) { String str = hobbyArr[i]; boolean flag = false;

for (int j = 0; j < hobbyRel.length; j++) { if (str.equals(hobbyRel[j])) {

flag = true;//说明有这项爱好 break; } }

if (flag) {

authorHobbySB.append(\"1\"); } else {

authorHobbySB.append(\"0\"); } }

book.setAuthorHobby(authorHobbySB.toString());

book.setAuthorSex(request.getParameter(\"authorSex\"));

bookType.setId(Integer.parseInt(request.getParameter(\"typeId\"))); book.setBookType(bookType); try {

modifyBook(book); out.print(true);

} catch (ClassNotFoundException e) { out.print(false);

out.println(\"数据修改失败!\"); } catch (SQLException e) { out.print(false);

out.println(\"数据更新失败!\"); }

%>

modifyBookForm.jsp

<%--

Document : modifyBook

Created on : 2013-12-10, 10:01:11 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\" import=\"java.sql.*,bms_bean.Book\"%> <%@include file=\"include.jsp\"%>

修改图书

修改图书

书名:

类型:

ISBN:

价格:

作者:

性别:

爱好:

  • java
  • 旅游
  • 上网
  • 看书
  • 睡觉
  • 钓鱼
  • 吃货
  • 跳舞
  • 美术
  • 唱歌

modifyBookShow.jsp

<%--

Document : modifyBookShow Created on : 2013-12-25, 17:51:37 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"UTF-8\" errorPage=\"error.jsp\" import=\"java.util.*,bms_bean.*,net.sf.json.JSONArray\"%> <%@include file=\"include.jsp\"%>

<%! //根据id找到相应的记录

String findBookByIdSql = \"select * from books where id=?\";

public Book findBookById(int id) throws SQLException, ClassNotFoundException { Connection conn = getConnection(); PreparedStatement prep = null; ResultSet rst = null; Book book = null;

BookType bookType = null; try {

prep = conn.prepareStatement(findBookByIdSql); prep.setInt(1, id);

rst = prep.executeQuery(); if (rst.next()) {

book = new Book();

bookType = new BookType(); book.setId(id);

book.setBookName(rst.getString(\"book_name\")); book.setIsbn(rst.getString(\"isbn\"));

book.setAuthor(rst.getString(\"author\")); book.setPrice(rst.getFloat(\"price\"));

bookType.setId(Integer.parseInt(rst.getString(\"type_id\"))); book.setBookType(bookType);

book.setAuthorSex(rst.getString(\"author_sex\"));

book.setAuthorHobby(rst.getString(\"author_hobby\")); }

} catch (SQLException ex) { ex.printStackTrace(); } finally { try {

rst.close(); prep.close();

} catch (SQLException ex) { ex.printStackTrace(); }

closeConnection(); }

return book; } %> <%

request.setCharacterEncoding(\"utf-8\"); response.setCharacterEncoding(\"utf-8\");

int id = Integer.parseInt(request.getParameter(\"id\")); Book book = null; try {

book = findBookById(id);

JSONArray arr = JSONArray.fromObject(book); out.print(arr.toString());

} catch (ClassNotFoundException e) { out.println(\"数据获取失败!\"); } catch (SQLException e) {

out.println(\"数据获取失败!\"); } %>

modifyValidateISBN.jsp

<%--

Document : validateIsbn

Created on : 2013-12-18, 9:00:45 Author : new --%>

<%@page contentType=\"text/html\" pageEncoding=\"utf-8\" errorPage=\"error.jsp\" import=\"java.sql.*,java.io.PrintWriter\"%> <%@include file=\"include.jsp\"%>

<%! //验证isbn

String validateIsbnSql = \"select * from books where isbn=?\";

public Integer validateIsbn(String isbn) { Connection conn = null;

PreparedStatement prep = null; ResultSet rst = null; Integer id = null; try {

conn = getConnection();

prep = conn.prepareStatement(validateIsbnSql); prep.setString(1, isbn); rst = prep.executeQuery(); if (rst.next()) {

id = rst.getInt(\"id\"); return id; } else {

return null; }

} catch (ClassNotFoundException e) { e.printStackTrace();

System.out.println(\"驱动加载失败\"); return null;

} catch (SQLException ex) { ex.printStackTrace();

System.out.println(\"数据库查询失败\"); return null; } finally { try {

if (rst != null) { rst.close(); }

if (prep != null) { prep.close(); }

closeConnection();

} catch (SQLException ex) { ex.printStackTrace();

System.out.println(\"数据库关闭异常\"); return null; } } } %>

<%

request.setCharacterEncoding(\"utf-8\"); response.setCharacterEncoding(\"utf-8\"); String isbn = request.getParameter(\"isbn\"); Integer id = null;

if (request.getParameter(\"id\") == null || request.getParameter(\"id\").equals(\"\")) { id = null; } else {

id = Integer.parseInt(request.getParameter(\"id\")); }

PrintWriter pw = response.getWriter();

pw.print(validateIsbn(isbn) == id || validateIsbn(isbn) == null); %>

…………………………………………………………………………………………………… CSS

Add_modify.css

body{

text-align: center; }

#modify_main{ width:600px; margin:0 auto;

padding-left:400px; text-align: left; }

.float_left{ float:left; }

.float_right{ float:right; }

.div_ul{

list-style-type:none; margin: 0px; padding:0px; }

.div_checkbox{ width:150px; float:left;

border:1px solid; border-color:#cccccc; }

.btn_div{

width:150px;

margin:50px auto; padding-top:80px;

font-family: 'Times New Roman',Times,serif; }

#authorHobby{

padding-top:18px; margin-bottom: 20px; }

#authorSex{

margin-top:18px; }

.div_radio{ width:150px; text-align: left; }

#bookType,#isbn,#price,#author{ margin-top:18px; }

List.css

table{

border:1px solid gray; border-collapse: collapse; border-spacing: 1px; text-align: center; width:1200px; }

table tr td,table tr th{ border:1px solid gray; width: 180px; height: 30px; }

/*条件查询区域的div*/ #search div{ display: inline; }

/*隔行变色*/

.over{

background-color: pink; }

/*第一列的宽度*/ .first_column{ width:250px; }

/*最后一列的宽度*/ .last_column{ width:70px; }

.hobby_column{ width:300px; }

/*去掉超连接的下划线*/ .a_decoration{

text-decoration:none; }

自己手动导出的数据库 mysql -- Host: localhost Database: book

CREATE TABLE `books` (

`author_hobby` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `author_sex` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, `type_id` int(10) NOT NULL,

`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',

`book_name` varchar(128) COLLATE utf8_unicode_ci NOT NULL COMMENT '书籍名称', `isbn` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'isbn', `author` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT '作者', `price` float(18,2) NOT NULL DEFAULT '0.00' COMMENT '书籍价格', PRIMARY KEY (`id`),

UNIQUE KEY `isbn` (`isbn`), KEY `type_id_fk` (`type_id`),

CONSTRAINT `type_id_fk` FOREIGN KEY (`type_id`) REFERENCES `book_type` (`id`) ON DELETE NO ACTION

) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='书籍信息';

INSERT INTO `books` VALUES ('1011000000','1',4,1,'计算机导论','101006104','王志强',32.04),('1111000000','1',4,2,'C语

言','101006105','张无忌',34.),('1000011010','1',4,4,'数据结构','101006107','李建全',45.67),('1000011010','0',4,5,'算法设计与分

析','101006108','高小玉',11.11),('1000011010','0',4,6,'计算机组成原理','101006109','程四',34.63),('1000011010','1',4,10,'大学物理

','101006113','陈德彬',34.45),('1000011010','1',1,30,'暴风雨','101006213','老舍',45.34),('1000011010','1',3,32,'平凡的世

界','101006217','路遥',76.43),('1000011010','1',1,33,'人生','101006218','路遥',23.23),('1000011010','1',1,34,'狼图

腾','101006219','姜戎',.76),('1000011010','0',1,36,'倾城之恋','101006221','张爱玲',32.23),('1000011010','0',1,37,'半生

缘','101006222','张爱玲',43.32),('1000011010','0',1,38,'面包树上的女人','101006223','张小娴',43.43),('1000011010','0',1,39,'那一

双雪靴','101006224','张小娴',43.23),('1000011010','0',3,45,'人生','101006229','杨笑笑',.32),('1000011010','0',3,46,'人

生','101006230','杨笑笑',.32),('1000011010','1',1,47,'家','101006231','巴金',23.23),('1000011010','1',1,48,'春','101006233','巴

金',43.),('1000011010','1',1,49,'秋','101006234','巴金',43.),('1000011010','1',1,51,'雾','101006235','巴金',.23),

('1000011010','0',6,52,'测试','101006236','测试',11.11),('1010101000','0',3,65,'加油,青春!','101006114','测试',43.),

('1001000110','0',1,66,'倾城之恋','101006502','测试',43.),('1100000011','0',6,67,'添加图书','101006503','测试',32.32);

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- zrrp.cn 版权所有 赣ICP备2024042808号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务