基于SSM基于在线阅读系统mysql数据源mysql数据源1.包含源程序,数据库脚本。代码和数据库脚本都有详细注释。
2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善
开发环境:
Eclipse ,MYSQL,JDK1.8,Tomcat 7
代码已经上传github,下载地址https://github.com/21503882/reading
涉及技术点:
MVC模式、SpringMvc、Mybatis、Spring、EasyUI、HTML、JavaScript、CSS、JQUERY、log4j、Ajax等
系统采用Mybatis框架实现ORM对象关系映射,前台JSP实现,后台springMvc映射,使用Spring框架进行整合。适合学习J2EE的一段时间的熟手,代码思路清晰,注解详细,数据库用的是mysql5.1,服务器用的tomcat7,JDK版本1.8. 编程软件Eclispe J2EE版本。是典型MVC架构,并且前后台分离
主要功能:
package fz.bayes;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.ToolRunner;
import org.apache.mahout.classifier.naivebayes.AbstractNaiveBayesClassifier;
import org.apache.mahout.classifier.naivebayes.BayesUtils;
import org.apache.mahout.classifier.naivebayes.NaiveBayesModel;
import org.apache.mahout.classifier.naivebayes.StandardNaiveBayesClassifier;
import org.apache.mahout.classifier.naivebayes.training.WeightsMapper;
import org.apache.mahout.common.AbstractJob;
import org.apache.mahout.common.HadoopUtil;
import org.apache.mahout.math.Vector;
/**
* ????????Job
* ???
* [
* 2.1,3.2,1.2
2.1,3.2,1.3
]
??????????з???(???????????????)
* @author fansy
*
*/
public class BayesClassifiedJob extends AbstractJob {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
ToolRunner.run(new Configuration(), new BayesClassifiedJob(),args);
}
@Override
public int run(String[] args) throws Exception {
addInputOption();
addOutputOption();
addOption("model","m", "The file where bayesian model store ");
addOption("labelIndex","labelIndex", "The file where the index store ");
addOption("labelNumber","ln", "The labels number ");
addOption("mapreduce","mr", "Whether use mapreduce, true use ,else not use ");
addOption("SV","SV","The input vector splitter ,default is comma",",");
if (parseArguments(args) == null) {
return -1;
}
Configuration conf=getConf();
Path input = getInputPath();
Path output = getOutputPath();
String labelNumber=getOption("labelNumber");
String modelPath=getOption("model");
String useMR = getOption("mapreduce");
String SV = getOption("SV");
String labelIndex = getOption("labelIndex");
int returnCode=-1;
if("true".endsWith(useMR)){
returnCode = useMRToClassify(conf,labelNumber,modelPath,input,output,SV,labelIndex);
}else{
returnCode = classify(conf,input, output, labelNumber, modelPath, SV, labelIndex);
}
return returnCode;
}
/**
* ??????
* @param conf
* @param input
* @param