求一个JAVA编写的一套 信息管理系统 要求有简单的界面 基本功能 增删改查之类 50
求一个JAVA编写的一套信息管理系统要求有简单的界面基本功能增删改查之类要有基本的功能有偿也可以增删改查之类的界面简单无所谓...
求一个JAVA编写的一套 信息管理系统 要求有简单的界面 基本功能 增删改查之类要有基本的功能 有偿也可以 增删改查之类的 界面简单无所谓
展开
1个回答
展开全部
这里可以给您一个思路。JSP页面部分可以考虑使用JQueryEasyUI来进行搭建,会相对来讲比较方便快捷,同时利于Jquery或Js对数据的操作。Java部分,推荐Servlet +Tomcat服务器的组合来搞定。下面会奉上之前写过的一个小案例,虽不完全,但是相信会对您有些帮助。Sql做好数据库连接和数据库就可以了,也相对来说比较简单。
下为Java代码的Servlet部分,仅做参考。仅仅为一个学生管理系统,包含增删改查操作。若有需要整个小项目文件,可以私我。望采纳。
package com.forlevin.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.forlevin.util.BaseDB;
import com.forlevin.util.Result;
import com.forlevin.util.Result1;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.forlevin.daoImpl.StudentDaoImpl;
import com.forlevin.vo.Student;
public class StudentServlet extends HttpServlet {
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
String method=request.getParameter("method");
//显示所有
if(method.equals("getAllStudents")){
int page=Integer.parseInt(request.getParameter("page"));
int size=Integer.parseInt(request.getParameter("rows"));
System.out.println(page+","+size);
ArrayList<Student> list=StudentDaoImpl.getAllStudent(page, size);
int total=StudentDaoImpl.getStudentCount();
/*JsonObject obj=new JsonObject();
Gson g=new Gson();
obj.addProperty("total",total);
obj.addProperty("rows",g.toJson(list));
out.write(obj.toString());*/
Map<String,Object> map=new HashMap<String, Object>();
map.put("total",total);
map.put("rows", list);
System.out.println(map);
out.write(new Gson().toJson(map));
}
//修改功能
if(method.equals("editStudent")){
String username=request.getParameter("editName");
String nickname=request.getParameter("editUname");
String password=request.getParameter("editPass");
//根据用户名判断用户是否存在
Student stu=StudentDaoImpl.getStuByName(username);
if(stu!=null){
Student s=new Student(username, password, nickname);
int i=StudentDaoImpl.updateStudent(s);
if(i>0){
out.write(Result.toClient(true,""));
}
}
}
//添加功能
if(method.equals("addStudent")){
String username=request.getParameter("addName");
String nickname=request.getParameter("addNick");
String password=request.getParameter("addPwd");
System.out.println(username+","+nickname+","+password);
Student s=StudentDaoImpl.getStuByName(username);
if(s==null){
Student stu=new Student(username, password, nickname);
//将用户信息插入数据库
int n=StudentDaoImpl.savePlayer(stu);
if(n>0){
out.write(Result.toClient(true,""));
}
}
}
//删除用户信息
if(method.equals("deleteStudent")){
int id=Integer.parseInt(request.getParameter("id"));
int i=StudentDaoImpl.deleteStudentById(id);
if(i>0){
out.write(Result.toClient(true,""));
}
}
out.flush();
out.close();
}
}
更多追问追答
追问
老哥 我需要源文件 能发给我吗
追答
可以的,请您加一下我的Q号。我将在闲时将整个文件发给您,包含建库语句,Java代码与HTML代码。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询