Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #1

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# BaikeSpider
# BaikeSpider
针对互动百科设计的爬虫,将爬取的数据存放与数据库中。

# 数据库

# 运行
## 环境要求
* java1.5以上
* mysql5.8以上

执行`baike.sql`在mysql创建对应的表

执行 com.spider.main.SpiderMain.main()
112 changes: 112 additions & 0 deletions baike.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.7.21-log


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


--
-- Create schema baike
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ baike;
USE baike;

--
-- Table structure for table `baike`.`entry`
--

DROP TABLE IF EXISTS `entry`;
CREATE TABLE `entry` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`publisher` varchar(255) NOT NULL DEFAULT '',
`content` text,
`picture_addr` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `baike`.`entry`
--

/*!40000 ALTER TABLE `entry` DISABLE KEYS */;
/*!40000 ALTER TABLE `entry` ENABLE KEYS */;


--
-- Table structure for table `baike`.`label`
--

DROP TABLE IF EXISTS `label`;
CREATE TABLE `label` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `baike`.`label`
--

/*!40000 ALTER TABLE `label` DISABLE KEYS */;
/*!40000 ALTER TABLE `label` ENABLE KEYS */;


--
-- Table structure for table `baike`.`label_link`
--

DROP TABLE IF EXISTS `label_link`;
CREATE TABLE `label_link` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` int(10) unsigned NOT NULL DEFAULT '0',
`label_id` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `baike`.`label_link`
--

/*!40000 ALTER TABLE `label_link` DISABLE KEYS */;
/*!40000 ALTER TABLE `label_link` ENABLE KEYS */;


--
-- Table structure for table `baike`.`url`
--

DROP TABLE IF EXISTS `url`;
CREATE TABLE `url` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(255) NOT NULL DEFAULT '',
`url_md5` varchar(255) NOT NULL DEFAULT '',
`status` int(10) unsigned NOT NULL DEFAULT '0',
`type` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '1为列表url,2为词条url',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `baike`.`url`
--

/*!40000 ALTER TABLE `url` DISABLE KEYS */;
/*!40000 ALTER TABLE `url` ENABLE KEYS */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
4 changes: 2 additions & 2 deletions src/jdbc.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/BaiKe?useUnicode=true&characterEncoding=UTF-8
username=root
password=hxh896900488
username=username
password=password
#定义初始连接数
initialSize=0
#定义最大连接数
Expand Down