赞
踩
首先建立两个数据库
music 为音乐
tb_user 为用户登录
model 实体类
dao 持久层 对数据库进行操作 增删改查
util 工具包 jdbc连接
exception 抛出异常
Test 音乐的主运行界面
View 用户的主运行界面
Music.java
package com.zhongruan.model;
public class Music {
private int id;
private String name;
private String author;
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 String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } @Override public String toString() { return "Music{" + "id=" + id + ", name='" + name + '\'' + ", author='" + author + '\'' + '}'; }
}
User.java
package com.zhongruan.model;
public class User {
public User(String username, String password ){
this.username = username;
this.password = password;
}
public User() {
}
private int id;
private String username;
private String password;
private int type;
public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public int getType() { return type; } public void setType(int type) { this.type = type; } @Override public String toString() { return "User{" + "id=" + id + ", username='" + username + '\'' + ", password='" + password + '\'' + ", type=" + type + '}'; }
}
MusicDao.java
package com.zhongruan.dao;
import com.zhongruan.model.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。