src/com/bar/db/Words.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bar.db;

/**
 *数据库表
  DROP TABLE IF EXISTS `words`;
  CREATE TABLE words (
  wordsid bigint(20) NOT NULL auto_increment,
  content mediumtext,
  userid bigint(20) NOT NULL default '0',
  goodinfoid bigint(20) NOT NULL default '0',
  createtime timestamp   NOT   NULL   default   CURRENT_TIMESTAMP,
  PRIMARY KEY  (wordsid),
  UNIQUE KEY wordsid (wordsid)
  ) TYPE=MyISAM;
 */


import java.sql.*;

public class Words extends ExecuteDB
{
	//定义类成员变量
	private long wordsid;
	private String content;
	private long userid;
	private long goodinfoid;
	private String strSql;

    //构造函数,对成员变量进行初始化赋值
	public Words()
	{
		this.wordsid=0;
		this.content="";
		this.goodinfoid=0;
		this.userid=0;
		this.strSql="";
	}

	//添加新留言,往words数据表中添加一条新记录
	public boolean add()
	{
		this.strSql="insert into words ";
		this.strSql=this.strSql + "(content,userid,goodinfoid)";
		this.strSql=this.strSql + "values('" + this.content + "','" + this.userid + "','" + this.goodinfoid + "')";
		boolean isAdd = super.exeSql(this.strSql);

		return isAdd;
	}

  	//获取wordsid对应的留言信息,将这些信息赋值给相应的类变量
	public boolean init()
	{
    	this.strSql="select * from `words` where wordsid=";
        this.strSql=this.strSql + "'" + this.wordsid + "'";
		try
后面还有 86 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。