第二次数据库作业--model

package model;

import java.util.Date;

/**
 * Created by yinus
 * Date:2016/4/6
 * Time:18:44
 */

public class C2S {
    private int stu_id;
    private int cou_id;
    private double credit;
    private Date create_time;
    private Date update_time;
    public C2S() {
    }

    public C2S(int stu_id, int cou_id, double credit) {
        this.stu_id = stu_id;
        this.cou_id = cou_id;
        this.credit = credit;
        create_time=new Date();
        update_time=new Date();
    }

    public int getStu_id() {
        return stu_id;
    }

    public void setStu_id(int stu_id) {
        this.stu_id = stu_id;
    }

    public int getCou_id() {
        return cou_id;
    }

    public void setCou_id(int cou_id) {
        this.cou_id = cou_id;
    }

    public double getCredit() {
        return credit;
    }

    public void setCredit(double credit) {
        this.credit = credit;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public Date getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }

    @Override
    public String toString() {
        return "studentId:"+this.getStu_id()+"  courseId:"+this.getCou_id()+" credit:"+this.getCredit();
    }
}
package model;

import java.util.Date;

/**
 * Created by yinus
 * Date:2016/4/6
 * Time:18:44
 */

public class Course {
    private int id;
    private String title;
    private Date createTime;
    private Date updateTime;

    public Course() {
    }

    public Course(int id, String title) {
        this.id = id;
        this.title = title;
        this.createTime = new Date();
        this.updateTime = new Date();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "id:"+this.getId()+"  name:"+this.getTitle()+"  createTime:"+this.getCreateTime()+"  updateTime:"+this.getUpdateTime();
    }
}
package model;

import java.util.Date;

/**
 * Created by yinus
 * Date:2016/4/6
 * Time:18:44
 */

public class Student {

    private int id;

    private String name;

    private Date createTime;

    private Date updateTime;

    public Student() {}

    public Student(int id, String name) {
        this.id = id;
        this.name = name;
        this.createTime = new Date();
        this.updateTime = new Date();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "id:"+this.getId()+"  name:"+this.getName()+"  createTime:"+this.getCreateTime()+"  updateTime:"+this.getUpdateTime();
    }
}
时间: 2024-10-12 17:35:26

第二次数据库作业--model的相关文章

第二次数据库作业--gui

1 package gui; 2 3 import action.C2SAction; 4 import action.CourseAction; 5 import action.StudentAction; 6 import javafx.application.Application; 7 import javafx.geometry.Insets; 8 import javafx.scene.Scene; 9 import javafx.scene.control.*; 10 import

第二次数据库作业--action

package action; import dao.C2SDao; import model.C2S; import java.sql.SQLException; import java.util.List; /** * Created by yinus * Date:2016/4/6 * Time:18:43 */ public class C2SAction { public void add(C2S c) throws SQLException { C2SDao cd = new C2S

第二次数据库作业--Main

import dao.CourseDao; import model.Course; import view.C2SView; import view.CourseView; import view.StudentView; import java.sql.SQLException; import java.util.List; import java.util.Scanner; /** * Created by yinus * Date:2016/4/8 * Time:16:09 */ pub

第二次数据库作业--view

package view; import action.C2SAction; import action.CourseAction; import action.StudentAction; import model.C2S; import model.Course; import model.Student; import java.sql.SQLException; import java.util.List; import java.util.Scanner; import java.ut

第二次数据库作业--dao

package dao; import model.C2S; import utils.Dbtuil; import java.sql.*; import java.util.ArrayList; import java.util.List; /** * Created by yinus * Date:2016/4/6 * Time:18:44 */ public class C2SDao { public void add(C2S cs) throws SQLException { Conne

Django 反向生成 从数据库生成Model

Django 反向生成 从数据库生成Model 使用Django生成Model python manage.py inspectdb或python manage.py inspectdb > models.py 就可以生成了自动产生Django model

SDN第二次上机作业

SDN第二次上机作业 1.安装floodlight 参考链接:http://www.sdnlab.com/19189.html 2.生成拓扑并连接控制器floodlight,利用控制器floodlight查看图形拓扑 拓扑如图所示 提交要求:控制器floodlight所示可视化图形拓扑的截图,及主机拓扑连通性检测截图 3.利用字符界面下发流表,使得'h1'和'h2' ping 不通 参考链接:http://www.sdnlab.com/19394.html 提交要求:流表截图,及拓扑连通性截图

数据库作业14——综合练习(二) 反馈情况

数据库作业14--综合练习(二) 反馈情况 一.作业要求复述 1.创建数据库CPXS,保存于E盘根目录下以自己学号+姓第一个字母(阿拉伯数字+大写字母)方式创建的文件夹中,初始大小5MB,最大20MB,以10%方式增长,日志文件存于同一文件夹,初始大小2MB,最大5MB,以1MB方式增长: 2.创建表CP,CPBH为主键,8位数字,CPMC,长度12个字符,JG为精确到小数点后2位,KCL为整数,除了KCL,其他都不能为空: 3.使用INSERT输入数据,具体数据如下: '10001100',

Oracle 用脚本安装第二个数据库

安装第二个数据库: 登录oracle用户进入家目录,添加配置环境变量: vi .bash_profier ORACLE_SID=prod2 临时环境变量: $export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 $export ORACLE_SID=prod2 创建第二个数据库文件目录: $mkdir -p /u01/app/oracle/oradata/prod2 创建sys用户密码文件: $cd /u01/app/oracle/prod