📄 words.java
字号:
package dlut;
import java.sql.*;
public class Words extends ExecuteDB {
private long wordID;
private String wordContent;
private long authorID;
private long bookID;
private String createTime;
private String strSql;
public Words() {
this.wordID = 0;
this.wordContent = "";
this.bookID = 0;
this.authorID = 0;
this.strSql = "";
}
public boolean addWord() {
this.strSql = "insert into words ";
this.strSql = this.strSql + "(";
this.strSql = this.strSql + "WordContent,";
this.strSql = this.strSql + "AuthorID,";
this.strSql = this.strSql + "BookID,";
this.strSql = this.strSql + "CreateTime";
this.strSql = this.strSql + ") ";
this.strSql = this.strSql + "values(";
this.strSql = this.strSql + "'" + this.wordContent + "',";
this.strSql = this.strSql + "'" + this.authorID + "',";
this.strSql = this.strSql + "'" + this.bookID + "',";
this.strSql = this.strSql + "sysdate";
this.strSql = this.strSql + ")";
System.out.println(this.strSql);
boolean isAdd = super.exeSql(this.strSql);
return isAdd;
}
public ResultSet showWords() {
this.strSql = "select * from words where BookID = ";
this.strSql = this.strSql + this.bookID;
ResultSet rs = null;
try {
rs = super.exeSqlQuery(this.strSql);
} catch (Exception ex) {
System.out.println(ex.toString());
}
return rs;
}
public void setWordID(long WordID) {
this.wordID = WordID;
}
public long getWordID() {
return this.wordID;
}
public void setWordContent(String WordContent) {
this.wordContent = WordContent;
}
public String getWordContent() {
return this.wordContent;
}
public void setAuthorID(long AuthorID) {
this.authorID = AuthorID;
}
public long getAuthorID() {
return this.authorID;
}
public void setBookID(long BookID) {
this.bookID = BookID;
}
public long getBookID() {
return this.bookID;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getCreateTime() {
return this.createTime;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -