Este artículo es un artículo espejo de traducción automática, por favor haga clic aquí para saltar al artículo original.

Vista: 13586|Respuesta: 2

[JavaSE] Sistema de gestión de información estudiantil escrito por JAVA

[Copiar enlace]
Publicado en 20/11/2014 20:43:50 | |Navega en orden |
Esta publicación fue editada por última vez por Delver_Si el 20-11-2014 a las 21:21

[mw_shl_code=sql,true]use master
¡Ve
si existe(selecciona * de sys.databases donde nombre = 'escuela')
        Escuela de la base de datos de descartes
¡Ve
Crear Escuela de Bases de Datos
¡Ve
Uso de la escuela
¡Ve
Crear tabla estudiante
(
        stu_id varchar(10) ,-- la clave primaria
        stu_name varchar(20) no nulo,-- nombre
        stu_addr Varchar (100) ,-- dirección
        stu_spec Varchar (50) ,-- profesional
        stu_dorm Varchar (50) — Residencia
)
¡Ve
insertar en valores estudiantiles ('100001', 'Zhang San', 'Wuhan Xu Dong', 'Ingeniería de la Información', '101')
insertar en valores estudiantiles ('100002', 'Li Si', 'Wuhan Xu Dong', 'Ingeniería de la Información', '102')

seleccionar * de estudiante

--eliminar de estudiante donde stu_id = '100001'

--actualizar conjunto de estudiantes stu_name = 'Li Si', stu_addr = 'Zhang San', stu_spec= 'Pruebas de software', stu_dorm = '1001' donde stu_id = '100001'[/mw_shl_code]

[mw_shl_code=java,true]paquete online.school.test;

import java.util.ArrayList;
importar java.util.List; importar online.school.domain.Student;
importar online.school.service.StudentService;

clase pública StudentTest {

        empty estático público main(String[] args) {
                nuevo StudentTest().getAllStudent();
        }
        public int addStudent() {
                Estudiante estudiante = nuevo estudiante ("3", "Wang Wu", "Xiaogan", "Pruebas de software", "103");
                return new StudentService().addStudent(student);
        }

        public int delStudent() {
                String stuId="3";
                return new StudentService().delStudent(stuId);
        }

        public void findStudent() {
                String stuId="3";
                Estudiante estudiante =nuevo StudentService().findStudent(stuId);
                System.out.println(student.toString());
        }

        public<Student> List getAllStudent() {
                ArrayList al = (ArrayList) nuevo StudentService().getAllStudent();
                for(int i =0; i<al.size(); i++){
                        Objecto[] obj =(Objeto[]) al.get(i);
                        for(int j=0; j<5; j++){
                                System.out.print(obj[j] + " ");
                        }
                        System.out.println();
                }
                devuelve a Al;
        }

        public int updateStudent() {

                Estudiante estudiante = nuevo estudiante ("3", "Wang Wu", "Yingcheng", "Ingeniería Civil", "103");
                nuevo StudentService().updateStudent(student);
                return 0;
               
        }
}
[/mw_shl_code]

[mw_shl_code=java,true]paquete online.school.domain;

clase pública Estudiante {
        
        soldado String stu_id; Número
        soldado String stu_name; Nombre
        soldado String stu_addr; - Dirección
        soldado raso String stu_spec; Profesional
        soldado raso String stu_dorm; Residencia
        Public String getStu_id() {
                regreso stu_id;
        }
        vacío público setStu_id(String stuId) {
                stu_id = stuId;
        }
        Public String getStu_name() {
                regreso stu_name;
        }
        empty público setStu_name(String stuName) {
                stu_name = stuName;
        }
        Public String getStu_addr() {
                regresar stu_addr;
        }
        vacío público setStu_addr(String stuAddr) {
                stu_addr = stuAddr;
        }
        Public String getStu_spec() {
                regreso stu_spec;
        }
        vacío público setStu_spec(String stuSpec) {
                stu_spec = stuSpec;
        }
        Public String getStu_dorm() {
                regreso stu_dorm;
        }
        vacío público setStu_dorm(String stuDorm) {
                stu_dorm = stuDorm;
        }
        
        
        
        public Student() {
                super();
        }
        Public Student (String stuId, String stuName, String stuAddr,
                        String stuSpec, String stuDorm) {
                super();
                stu_id = stuId;
                stu_name = stuName;
                stu_addr = stuAddr;
                stu_spec = stuSpec;
                stu_dorm = stuDorm;
        }
        @Override
        public String toString() {
                return "Estudiante [stu_addr=" + stu_addr + ", stu_dorm=" + stu_dorm
                                + ", stu_id=" + stu_id + ", stu_name=" + stu_name
                                + ", stu_spec=" + stu_spec + "]";
        }
        
        
        

}
[/mw_shl_code]
[mw_shl_code=java,true]paquete online.school.service;

importar java.util.List;

importar online.school.dao.StudentDao;
importar online.school.domain.Student;
importar online.school.utils.SqlHelp;

la clase pública StudentService implementa IStudentService{

        @Override
        public int addStudent(Student student) {
               
                String sql = "insertar en los valores del alumno(?,?,?,?,?)";
                return new StudentDao().addStudent(sql,student.getStu_id(),student.getStu_name(),student.getStu_addr(),student.getStu_spec(),student.getStu_dorm());
        }

        @Override
        public int delStudent(String stuId) {
                String sql = "eliminar del estudiante donde stu_id = ?";
                return new StudentDao().delStudent(sql, stuId);
        }

        @Override
        public Student findStudent(String stuId) {
                String sql = "seleccionar * de estudiante donde stu_id = ?";
                return new StudentDao().findStudent(sql, stuId);
        }

        @Override
        public<Student> List getAllStudent() {
                String sql = "seleccionar * de estudiante";
                return new StudentDao().getAllStudent(sql);
        }

        @Override
        public int updateStudent(Student student) {
                String sql = "actualizar conjunto de estudiantes stu_name = ?,stu_addr = ?, stu_spec= ?,stu_dorm = ? donde stu_id = ?";
                return new StudentDao().updateStudent(sql, student.getStu_name(),student.getStu_addr(),student.getStu_spec(),student.getStu_dorm(),student.getStu_id());
               
        }

        

        
}
[/mw_shl_code] [mw_shl_code=java,true]paquete online.school.dao;

import java.util.ArrayList;
importar java.util.List;
importar online.school.domain.Student;
importar online.school.utils.SqlHelp;

la clase pública StudentDao implementa IStudentDao{

        @Override
        public int addStudent(String sql, String... args) {
                return new SqlHelp().executeUpdate(sql,args);
               
        }

        @Override
        public int delStudent (String sql, String... args) {
                return new SqlHelp().executeUpdate(sql,args);
        }

        @Override
        público Estudiante encuentra Estudiante (String sql, String... args) {
                ArrayList al = new SqlHelp().executeQuery(sql, args);
                        Objeto[] obj =(Objeto[]) al.get(0);
                        Estudiante estudiante = nuevo estudiante();
                        student.setStu_id((Cuerda) obj[0]);
                        student.setStu_name((Cuerda) obj[1]);
                        student.setStu_addr((Cuerda) obj[2]);
                        student.setStu_spec((Cuerda) obj[3]);
                        student.setStu_dorm((Cuerda) obj[4]);
                        estudiante que regresa;
               
        }

        @Override
        public<Student> List getAllStudent(String sql) {

                ArrayList al = new SqlHelp().executeQuery(sql);
                devuelve a Al;
        }

        @Override
        public int updateStudent(String sql, String... args) {
               
                return new SqlHelp().executeUpdate(sql, args);
               
        }

        
        
}
[/mw_shl_code]

stuManager.rar

507,45 KB, Tiempos de descarga: 0, Créditos de descarga: -1 prestigio, -1 contribución

Precio de venda:2 MB [Grabación]  [compra]





Anterior:Recientemente, estoy haciendo un proyecto en una librería online, que es una función de registro que se ha realizado en los últimos días
Próximo:Versión en C# del sistema de gestión estudiantil
 Propietario| Publicado en 20/11/2014 21:20:55 |
admin publicado el 20-11-2014 a las 21:13
Se recomienda que el propietario venda el código fuente del archivo adjunto por 2 euros

:victoria:
Publicado en 20/11/2014 21:13:20 |
Se recomienda que el propietario venda el código fuente del archivo adjunto por 2 euros
Renuncia:
Todo el software, materiales de programación o artículos publicados por Code Farmer Network son únicamente para fines de aprendizaje e investigación; El contenido anterior no se utilizará con fines comerciales o ilegales; de lo contrario, los usuarios asumirán todas las consecuencias. La información de este sitio proviene de Internet, y las disputas de derechos de autor no tienen nada que ver con este sitio. Debes eliminar completamente el contenido anterior de tu ordenador en un plazo de 24 horas desde la descarga. Si te gusta el programa, por favor apoya el software genuino, compra el registro y obtén mejores servicios genuinos. Si hay alguna infracción, por favor contáctanos por correo electrónico.

Mail To:help@itsvse.com