Java学生管理系统项目案例
这是一个不错的Java学生管理系统项目案例,希望能够帮到大家的学习吧。
分代码如下
package com.student.util; import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException; public class DbUtil {
private String dbUrl="jdbc:mysql://localhost:3306/db_student";
private String user="root";
private String password="123456";
private String jdbcName="com.mysql.jdbc.Driver";
public Connection getCon() throws Exception{
Class.forName(jdbcName);
Connection con=DriverManager.getConnection(dbUrl, user, password);
return con;
}
public void close(Connection con)throws Exception{
if(con!=null){
con.close();
}
}
public static void main(String[] args){
Connection con=null;
try {
con = new DbUtil().getCon();
System.out.println(con);
} catch (Exception e) {
e.printStackTrace();
}finally{
if(con!=null){
try {
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
}
package com.student.model;
public class Student {
private int id;
private String studentnumber;
private String name;
private String birthday;
private String nativeplace;
private int classid;
private String studentremark;
public Student() {
super();
}
public Student(String studentnumber, String name, String birthday,
String nativeplace, int classid, String studentremark) {
super();
this.studentnumber = studentnumber;
this.name = name;
this.birthday = birthday;
this.nativeplace = nativeplace;
this.classid = classid;
this.studentremark = studentremark;
}
public Student(int id, String studentnumber, String name, String birthday,
String nativeplace, int classid, String studentremark) {
super();
this.id = id;
this.studentnumber = studentnumber;
this.name = name;
this.birthday = birthday;
this.nativeplace = nativeplace;
this.classid = classid;
this.studentremark = studentremark;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getStudentnumber() {
return studentnumber;
}
public void setStudentnumber(String studentnumber) {
this.studentnumber = studentnumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getNativeplace() {
return nativeplace;
}
public void setNativeplace(String nativeplace) {
this.nativeplace = nativeplace;
}
public int getClassid() {
return classid;
}
public void setClassid(int classid) {
this.classid = classid;
}
public String getStudentremark() {
return studentremark;
}
public void setStudentremark(String studentremark) {
this.studentremark = studentremark;
}
}
效果图
<ignore_js_op>
<ignore_js_op>
详细说明:http://java.662p.com/thread-3620-1-1.html
Java学生管理系统项目案例的更多相关文章
- Java学生管理系统(详解)
相信大部分人都有接触过这个 Java 小项目--学生管理系统,下面会分享我在做这个项目时的一些方法以及程序代码供大家参考(最后附上完整的项目代码). 首本人只是个初学Java的小白,可能项目中有许多地 ...
- Java学生管理系统(连接数据库查询)超详细
这几天逼着交Java,借鉴各位师傅的做出来这么个简陋的东西,各位大师傅不要笑我.(学都没有学过Java的我,QAQ~) 下面针对的都是SQL Server系列的连接,如果你使用MySQL那么不必看关于 ...
- java学生管理系统
student类 package cn.itheima.Manag; /** * *标准类 * **/public class Student { //学号 private String id; // ...
- Java学生管理系统(IO版)
图解: cade: student.java /* * 这是我的学生类 */ public class Student { //学号 private String id; //姓名 private S ...
- 【Java框架型项目从入门到装逼】第七节 - 学生管理系统项目搭建
本次的教程是打算用Spring,SpringMVC以及传统的jdbc技术来制作一个简单的增删改查项目,对用户信息进行增删改查,就这么简单. 1.新建项目 首先,打开eclipse,新建一个web项目. ...
- java学生管理系统(增、删、改、查功能)
package mm; import java.util.Scanner;import java.util.ArrayList; class Student1 { private String stu ...
- Java开发学生管理系统
Java 学生管理系统 使用JDBC了链接本地MySQL 数据库,因此在没有建立好数据库的情况下没法成功运行 (数据库部分, Java界面部分, JDBC部分) 资源下载: http://downlo ...
- Java案例——学生管理系统
简单完整的学生管理系统 学生类 public class Student { private String id; private String age; private String name; p ...
- Java基础进阶:学生管理系统数组方式分包源码实现,教师管理系统集合和数组两种方式源码实现,图书馆管理系统源码实现,现附重难点,代码实现源码,课堂笔记,课后扩展及答案
1.案例驱动模式 1.1案例驱动模式概述 (理解) 通过我们已掌握的知识点,先实现一个案例,然后找出这个案例中,存在的一些问题,在通过新知识点解决问题 1.2案例驱动模式的好处 (理解) 解决重复代码 ...
随机推荐
- ArrayList,Vector线程安全性测试
import java.util.ArrayList; import java.util.List; //实现Runnable接口的线程 public class HelloThread implem ...
- android之location03
private class ButtonListener implements OnClickListener { @Override public void onClick(View v) { // ...
- eclipse ide for java ee developers 开发环境搭建(j2ee)
转载自:http://www.iteye.com/topic/982182 真的是一片很不错的文章啊! 使用eclipse真的有年头了,相信java程序员没有不知道它的,最近在给团队中新来的应届生做指 ...
- Getting started with SciPy for .NET
Getting started with SciPy for .NET 1.) IronPython Download and install IronPython 2.7, this will re ...
- SOAP: java+xfire(web service) + php客户端
作者: 吴俊杰 web service这项技术暂不说它有多落伍,但是项目中用到了,没法逃避! xml和json各有各的好处,但是JSON无疑是当今数据交互的主流了.客户soap服务器端用的是 j ...
- Java中的GC操作及相关概念
一.GC Roots Tracing的基本思路:通过一系列名为"GC Roots"的对象作为起始点,从这些节点开始向下搜索,搜索所经过的路径称为引用链(Reference Chai ...
- [ActionScript 3.0] AS3 时间日期格式化DateTimeFormatter类的运用
import flash.globalization.DateTimeFormatter; var _timeFormatter:DateTimeFormatter; var _dateFormatt ...
- editplus格式化xml文档
使用editplus打开xml文档,发现文件内容没有格式化,非常难看,使用IE9打开这个xml文档是格式化的,但是IE9打开不能编辑. 在网上找了一些资料发现能够通过一个小插件来是editplus格式 ...
- LeetCode 101. Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For e ...
- cookie、session、sessionid 与jsessionid
可查看 http://www.cnblogs.com/fnng/archive/2012/08/14/2637279.html