src/com/bar/db/Ku.java

(开头部分) 3KB

这里只显示每个文件的开头 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 `ku`;
  CREATE TABLE ku (
  kuid bigint(20) NOT NULL auto_increment,
  goodname bigint(20) NOT NULL default '0',
  num varchar(100) default NULL,
  PRIMARY KEY  (kuid),
  UNIQUE KEY kuid (kuid)
  ) TYPE=MyISAM;
 * 
 */
public class Ku extends ExecuteDB {
    	//定义类成员变量
	private long kuid;
	private String goodname;
	private int num;
	private String strSql;

    //构造函数,对成员变量进行初始化赋值
	public Ku()
	{
		this.kuid=0;
		this.goodname="";
		this.num=0;
		this.strSql="";
	}
        //添加库存信息,往KU数据表中添加一条新记录
	public boolean add()
	{
		this.strSql="insert into ku ";
		this.strSql=this.strSql + "(goodname,num)";
		this.strSql=this.strSql + "values('" + this.goodname + "','" + this.num + "')";
		boolean isAdd = super.exeSql(this.strSql);

		return isAdd;
	}
        //获取wordsid对应的留言信息,将这些信息赋值给相应的类变量
	public boolean init()
	{
    	this.strSql="select * from `ku` where kuid=";
        this.strSql=this.strSql + "'" + this.kuid + "'";
		try
		{
   			ResultSet rs = super.exeQuery(this.strSql);
			if (rs.next())
			{
                kuid=rs.getLong("kuid");
                goodname=rs.getString("goodname");
                num=rs.getInt("num");
                return true;
			}
			else
后面还有 103 行代码,购买后查看完整代码

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

AI 解读 AI

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

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