最近策划提了个需求,但是已有的数据不能满足需要,于是内容资源部制作了份excel表格补充。So,任务来了,读取并使用excel数据。由于感觉excel表格里的数据使用频率较高,那么就不能等到需要了才去读取excel,所以决定采用先把excel读取出来写进数据库然后再读取数据库的方式。Just do it !
首先,根据excel表格创建对象:
package com.eebbk.englishpointread.extravoice;
public class ExtraVoiceInfo {
private int id;
/**
* 单词内容
*/
private String content;
/**
* 音标
*/
private String phonetic;
/**
* 词性
*/
private String property;
/**
* 释义
*/
private String paraphrase;
/**
* 美式发音名称
*/
private String usVoiceName;
/**
* 英式发音名称
*/
private String ukVoiceName;
public ExtraVoiceInfo() {
}
public ExtraVoiceInfo(int id, String content, String phonetic, String property, String paraphrase,
String usVoiceName, String ukVoiceName) {
super();
this.id = id;
this.content = content;
this.phonetic = phonetic;
this.property = property;
this.paraphrase = paraphrase;
this.usVoiceName = usVoiceName;
this.ukVoiceName = ukVoiceName;
}
public ExtraVoiceInfo(String content, String phonetic, String property, String paraphrase, String usVoiceName,
String ukVoiceName) {
super();
this.content = content;
this.phonetic = phonetic;
this.property = property;
this.paraphrase = paraphrase;
this.usVoiceName = usVoiceName;
this.ukVoiceName = ukVoiceName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getPhonetic() {
return phonetic;
}
public void setPhonetic(String phonetic) {
this.phonetic = phonetic;
}
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}