A Java-based client-server application for managing library book data with web crawling capabilities.
- User authentication system
- Book data management:
- Display library data
- Web crawling of book information from Dangdang.com
- Query books by title, author, publisher, or price
- Delete book records
- Update book information
- Export data to CSV or XLS formats
- Multi-threaded web crawler
- Client-server architecture using Socket communication
- JSON-based data exchange
- MySQL database integration
- Java
- MySQL
- Socket Programming
- GSON for JSON handling
- JSoup for web crawling
- JXL for Excel file handling
src/
├── client/
│ └── Client.java # Client-side application
├── server/
│ ├── Server.java # Server application
│ ├── dao/
│ │ └── UserDAO.java # Data Access Object for users
│ ├── thread/
│ │ └── HandleThread.java # Server thread handler
│ ├── tools/
│ │ ├── crawling/ # Web crawling components
│ │ ├── DBConnection.java # Database connection utility
│ │ ├── Encoding.java # Encoding utilities
│ │ ├── ExportToCSV.java # CSV export functionality
│ │ └── ExportToXLS.java # Excel export functionality
│ └── vo/
│ └── User.java # User value object
-
Install MySQL and create a database named
lda -
Configure database connection in
src/server/tools/DBConnection.java:private final static String url = "jdbc:mysql://localhost:3306/lda?allowPublicKeyRetrieval=true&useSSL=false"; private final static String user = "root"; private final static String password = "your_password";
-
Compile the project
-
Start the server:
java server.Server -
Start the client:
java client.Client
- Login with your credentials
- Use the menu to:
- View library data
- Crawl new book data
- Query specific books
- Delete books
- Modify book information
- Export data to CSV/XLS
Copyright © Xi Xu
Licensed under the GPL-3.0 license.