src/com/bar/db/Talk.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.bar.db;
import java.sql.*;
/**
*
*DROP TABLE IF EXISTS `talk`;
CREATE TABLE talk (
talkid bigint(20) NOT NULL auto_increment,
content mediumtext,
userid bigint(20) NOT NULL default '0',
createtime timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (talkid),
UNIQUE KEY talkid (talkid)
) TYPE=MyISAM;
*
*/
public class Talk extends ExecuteDB{
private long talkid;
private String content;
private long userid;
private String strSql;
public Talk()
{
this.talkid = 0;
this.content="";
this.userid = 0;
this.strSql ="";
}
//添加新留言
public boolean add()
{
this.strSql="insert into talk ";
this.strSql=this.strSql + "(content,userid)";
this.strSql=this.strSql + "values('" + this.content + "','" + this.userid + "')";
boolean isAdd = super.exeSql(this.strSql);
return isAdd;
}
//删除留言
public boolean delete(String stalk)
{
this.strSql = "delete from talk where talkid in ( ";
this.strSql = this.strSql + stalk + ")";
boolean isDelete = super.exeSql(this.strSql);
return isDelete;
}
//获取wordsid对应的留言信息,将这些信息赋值给相应的类变量
public boolean init()
{
this.strSql="select * from `talk` where talkid=";
this.strSql=this.strSql + "'" + this.talkid + "'";
try
{
ResultSet rs = super.exeQuery(this.strSql);
后面还有 67 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。