@Override
	public void run() {
		PaperIDList = getResultSet();
		String insert = "insert into tf(term,paperid,count,totalcount,tf) values(?,?,?,?,?);";
		int record = 0;
		try {
			SQLconnection connection = new connection().conn();
			PreparedStatement statement = connection.conn
					.prepareStatement(insert);
			int totalcount=0;
			while (PaperIDList.next()) {
				Map<String, Integer> termcountMap = new HashMap<>();
				int id = PaperIDList.getInt("paperid");
				termcountMap =getTerms(connection, id);
				totalcount=getTotalTermCount(connection, id);
				for(String term:termcountMap.keySet())
				{
					int count=termcountMap.get(term);
					float tf=(float)count/totalcount;
					statement.setString(1, term);
					statement.setInt(2, id);
					statement.setInt(3, count);
					statement.setInt(4, totalcount);
					statement.setDouble(5, tf);
					statement.addBatch();
					record++;
					if (record % 1000 == 0) {
						System.out.println(name + "-record number: " + record);
						statement.executeBatch();
						statement.clearBatch();
						connection.disconnectMySQL();
						connection = new connection().conn();
						statement.close();
						statement = connection.conn.prepareStatement(insert);
					}
				}
			}
			statement.executeBatch();
			statement.clearBatch();
			statement.close();
			PaperIDList.close();
			connection.disconnectMySQL();
			this.sqLconnection.disconnectMySQL();
			connection.disconnectMySQL();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}