问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

石家庄铁道大学工程管理到底怎么样啊 我是男生 听说男的学这个不怎么样

发布网友 发布时间:2022-04-10 15:34

我来回答

5个回答

懂视网 时间:2022-04-10 19:56

com.hjf.util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * 数据库连接工具 * @author Hu * */ public class DBUtil { public static String db_url = "jdbc:mysql://localhost:3306/test"; public static String db_user = "root"; //账号 public static String db_pass = "root"; //密码 public static Connection getConn () { Connection conn = null; try { Class.forName("com.mysql.jdbc.Driver");//加载驱动 conn = DriverManager.getConnection(db_url, db_user, db_pass); } catch (Exception e) { e.printStackTrace(); } return conn; } /** * 关闭连接 * @param state * @param conn */ public static void close (Statement state, Connection conn) { if (state != null) { try { state.close(); } catch (SQLException e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } public static void close (ResultSet rs, Statement state, Connection conn) { if (rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } if (state != null) { try { state.close(); } catch (SQLException e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } }

2 在建立一个Course类,其中含有 id,name,teacher,classroom。

源码如下:

package com.hjf.entity;

public class Course {

 private int id;
 private String name;
 private String teacher;
 private String classroom;
 
 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 getTeacher() {
 return teacher;
 }
 public void setTeacher(String teacher) {
 this.teacher = teacher;
 }
 public String getClassroom() {
 return classroom;
 }
 public void setClassroom(String classroom) {
 this.classroom = classroom;
 }
 
 public Course() {}
 
 public Course(int id, String name, String teacher, String classroom) {
 this.id = id;
 this.name = name;
 this.teacher = teacher;
 this.classroom = classroom;
 }
 
 public Course(String name, String teacher, String classroom) {
 this.name = name;
 this.teacher = teacher;
 this.classroom = classroom;
 }
}

3、创建CourseDao类 来实现课程信息管理的增删该查操作。

源代码如下:

package com.hjf.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.hjf.entity.Course;
import com.hjf.util.DBUtil;

/**
 * 课程Dao
 * Dao层操作数据
 * @author Hu
 *
 */
public class CourseDao {

 /**
 * 添加
 * @param course
 * @return
 */
 public boolean add(Course course) {
 String sql = "insert into course(name, teacher, classroom) values(‘" + course.getName() + "‘,‘" + course.getTeacher() + "‘,‘" + course.getClassroom() + "‘)";
 Connection conn = DBUtil.getConn();
 Statement state = null;
 boolean f = false;
 int a = 0;
 
 try {
  state = conn.createStatement();
  state.executeUpdate(sql);
 } catch (Exception e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(state, conn);
 }
 
 if (a > 0) {
  f = true;
 }
 return f;
 }

 /**
 * 删除
 * 
 * @param id
 * @return
 */
 public boolean delete (int id) {
 boolean f = false;
 String sql = "delete from course where id=‘" + id + "‘";
 Connection conn = DBUtil.getConn();
 Statement state = null;
 int a = 0;
 
 try {
  state = conn.createStatement();
  a = state.executeUpdate(sql);
 } catch (SQLException e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(state, conn);
 }
 
 if (a > 0) {
  f = true;
 }
 return f;
 }

 /**
 * 修改
 * @param name
 * @param pass
 */
 public boolean update(Course course) {
 String sql = "update course set name=‘" + course.getName() + "‘, teacher=‘" + course.getTeacher() + "‘, classroom=‘" + course.getClassroom()
  + "‘ where id=‘" + course.getId() + "‘";
 Connection conn = DBUtil.getConn();
 Statement state = null;
 boolean f = false;
 int a = 0;

 try {
  state = conn.createStatement();
  a = state.executeUpdate(sql);
 } catch (SQLException e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(state, conn);
 }
 
 if (a > 0) {
  f = true;
 }
 return f;
 }
 
 /**
 * 验证课程名称是否唯一
 * true --- 不唯一
 * @param name
 * @return
 */
 public boolean name(String name) {
 boolean flag = false;
 String sql = "select name from course where name = ‘" + name + "‘";
 Connection conn = DBUtil.getConn();
 Statement state = null;
 ResultSet rs = null;
 
 try {
  state = conn.createStatement();
  rs = state.executeQuery(sql);
  while (rs.next()) {
  flag = true;
  }
 } catch (SQLException e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(rs, state, conn);
 }
 return flag;
 }
 
 /**
 * 通过ID得到类
 * @param id
 * @return
 */
 public Course getCourseById(int id) {
 String sql = "select * from course where id =‘" + id + "‘";
 Connection conn = DBUtil.getConn();
 Statement state = null;
 ResultSet rs = null;
 Course course = null;
 
 try {
  state = conn.createStatement();
  rs = state.executeQuery(sql);
  while (rs.next()) {
  String name = rs.getString("name");
  String teacher = rs.getString("teacher");
  String classroom = rs.getString("classroom");
  course = new Course(id, name, teacher, classroom);
  }
 } catch (Exception e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(rs, state, conn);
 }
 
 return course;
 }
 
 /**
 * 通过name得到Course
 * @param name
 * @return
 */
 public Course getCourseByName(String name) {
 String sql = "select * from course where name =‘" + name + "‘";
 Connection conn = DBUtil.getConn();
 Statement state = null;
 ResultSet rs = null;
 Course course = null;
 
 try {
  state = conn.createStatement();
  rs = state.executeQuery(sql);
  while (rs.next()) {
  int id = rs.getInt("id");
  String teacher = rs.getString("teacher");
  String classroom = rs.getString("classroom");
  course = new Course(id, name, teacher, classroom);
  }
 } catch (Exception e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(rs, state, conn);
 }
 
 return course;
 }
 
 /**
 * 查找
 * @param name
 * @param teacher
 * @param classroom
 * @return
 */
 public List<Course> search(String name, String teacher, String classroom) {
 String sql = "select * from course where ";
 if (name != "") {
  sql += "name like ‘%" + name + "%‘";
 }
 if (teacher != "") {
  sql += "teacher like ‘%" + teacher + "%‘";
 }
 if (classroom != "") {
  sql += "classroom like ‘%" + classroom + "%‘";
 }
 List<Course> list = new ArrayList<>();
 Connection conn = DBUtil.getConn();
 Statement state = null;
 ResultSet rs = null;

 try {
  state = conn.createStatement();
  rs = state.executeQuery(sql);
  Course bean = null;
  while (rs.next()) {
  int id = rs.getInt("id");
  String name2 = rs.getString("name");
  String teacher2 = rs.getString("teacher");
  String classroom2 = rs.getString("classroom");
  bean = new Course(id, name2, teacher2, classroom2);
  list.add(bean);
  }
 } catch (SQLException e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(rs, state, conn);
 }
 
 return list;
 }
 
 /**
 * 全部数据
 * @param name
 * @param teacher
 * @param classroom
 * @return
 */
 public List<Course> list() {
 String sql = "select * from course";
 List<Course> list = new ArrayList<>();
 Connection conn = DBUtil.getConn();
 Statement state = null;
 ResultSet rs = null;

 try {
  state = conn.createStatement();
  rs = state.executeQuery(sql);
  Course bean = null;
  while (rs.next()) {
  int id = rs.getInt("id");
  String name2 = rs.getString("name");
  String teacher2 = rs.getString("teacher");
  String classroom2 = rs.getString("classroom");
  bean = new Course(id, name2, teacher2, classroom2);
  list.add(bean);
  }
 } catch (SQLException e) {
  e.printStackTrace();
 } finally {
  DBUtil.close(rs, state, conn);
 }
 
 return list;
 }

}

4、调用上述增删改查的函数。

源码如下:

package com.hjf.service;

import java.util.List;

import com.hjf.dao.CourseDao;
import com.hjf.entity.Course;

/**
 * CourseService
 * 服务层
 * @author Hu
 *
 */
public class CourseService {

 CourseDao cDao = new CourseDao();
 
 /**
 * 添加
 * @param course
 * @return
 */
 public boolean add(Course course) {
 boolean f = false;
 if(!cDao.name(course.getName())) {
  cDao.add(course);
  f = true;
 }
 return f;
 }
 
 /**
 * 删除
 */
 public void del(int id) {
 cDao.delete(id);
 }
 
 /**
 * 修改
 * @return 
 */
 public void update(Course course) {
 cDao.update(course);
 }
 
 /**
 * 通过ID得到一个Course
 * @return 
 */
 public Course getCourseById(int id) {
 return cDao.getCourseById(id);
 }

 /**
 * 通过Name得到一个Course
 * @return 
 */
 public Course getCourseByName(String name) {
 return cDao.getCourseByName(name);
 }
 
 /**
 * 查找
 * @return 
 */
 public List<Course> search(String name, String teacher, String classroom) {
 return cDao.search(name, teacher, classroom);
 }
 
 /**
 * 全部数据
 * @return 
 */
 public List<Course> list() {
 return cDao.list();
 

5、创建CourseServlet类,其作用是根据输入的数据,通过Servlet进行处理,对输入结果做出正确与否的提示。

源码如下:

package com.hjf.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hjf.entity.Course;
import com.hjf.service.CourseService;

@WebServlet("/CourseServlet")
public class CourseServlet extends HttpServlet {
 
 private static final long serialVersionUID = 1L;

 CourseService service = new CourseService();
 
 /**
 * 方法选择
 */
 protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 req.setCharacterEncoding("utf-8");
 String method = req.getParameter("method");
 if ("add".equals(method)) {
  add(req, resp);
 } else if ("del".equals(method)) {
  del(req, resp);
 } else if ("update".equals(method)) {
  update(req, resp);
 } else if ("search".equals(method)) {
  search(req, resp);
 } else if ("getcoursebyid".equals(method)) {
  getCourseById(req, resp);
 } else if ("getcoursebyname".equals(method)) {
  getCourseByName(req, resp);
 } else if ("list".equals(method)) {
  list(req, resp);
 }
 }

 /**
 * 添加
 * @param req
 * @param resp
 * @throws IOException 
 * @throws ServletException 
 */
 private void add(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
 req.setCharacterEncoding("utf-8");
 String name = req.getParameter("name");
 String teacher = req.getParameter("teacher");
 String classroom = req.getParameter("classroom");
 Course course = new Course(name, teacher, classroom);
 
 //添加后消息显示
 if(service.add(course)) {
  req.setAttribute("message", "添加成功");
  req.getRequestDispatcher("add.jsp").forward(req,resp);
 } else {
  req.setAttribute("message", "课程名称重复,请重新录入");
  req.getRequestDispatcher("add.jsp").forward(req,resp);
 }
 }
 
 /**
 * 全部
 * @param req
 * @param resp
 * @throws ServletException 
 */
 private void list(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
 req.setCharacterEncoding("utf-8");
 List<Course> courses = service.list();
 req.setAttribute("courses", courses);
 req.getRequestDispatcher("list.jsp").forward(req,resp);
 }

 /**
 * 通过ID得到Course
 * @param req
 * @param resp
 * @throws ServletException 
 */
 private void getCourseById(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
 req.setCharacterEncoding("utf-8");
 int id = Integer.parseInt(req.getParameter("id"));
 Course course = service.getCourseById(id);
 req.setAttribute("course", course);
 req.getRequestDispatcher("detail2.jsp").forward(req,resp);
 }

 /**
 * 通过名字查找
 * 跳转至删除
 * @param req
 * @param resp
 * @throws IOException
 * @throws ServletException 
 */
 private void getCourseByName(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
 req.setCharacterEncoding("utf-8");
 String name = req.getParameter("name");
 Course course = service.getCourseByName(name);
 if(course == null) {
  req.setAttribute("message", "查无此课程!");
  req.getRequestDispatcher("del.jsp").forward(req,resp);
 } else {
  req.setAttribute("course", course);
  req.getRequestDispatcher("detail.jsp").forward(req,resp);
 }
 }
 
 /**
 * 删除
 * @param req
 * @param resp
 * @throws IOException
 * @throws ServletException 
 */
 private void del(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
 req.setCharacterEncoding("utf-8");
 int id = Integer.parseInt(req.getParameter("id"));
 service.del(id);
 req.setAttribute("message", "删除成功!");
 req.getRequestDispatcher("del.jsp").forward(req,resp);
 }
 
 /**
 * 修改
 * @param req
 * @param resp
 * @throws IOException
 * @throws ServletException 
 */
 private void update(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
 req.setCharacterEncoding("utf-8");
 int id = Integer.parseInt(req.getParameter("id"));
 String name = req.getParameter("name");
 String teacher = req.getParameter("teacher");
 String classroom = req.getParameter("classroom");
 Course course = new Course(id, name, teacher, classroom);
 
 service.update(course);
 req.setAttribute("message", "修改成功");
 req.getRequestDispatcher("CourseServlet?method=list").forward(req,resp);
 }
 
 /**
 * 查找
 * @param req
 * @param resp
 * @throws ServletException 
 */
 private void search(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
 req.setCharacterEncoding("utf-8");
 String name = req.getParameter("name");
 String teacher = req.getParameter("teacher");
 String classroom = req.getParameter("classroom");
 List<Course> courses = service.search(name, teacher, classroom);
 req.setAttribute("courses", courses);
 req.getRequestDispatcher("searchlist.jsp").forward(req,resp);
 }
}

6、搭建主界面。在其中加入一些连接实现页面的跳转。

主页面设置,源码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>
<style>
 .a{
 font-size: 26px;
 margin-top: 20px;
 }
</style>
</head>
<body>
 <div align="center">
 <h1 style="color: red;">课程基本
信息管理系统</h1>
 <div class="a">
  <a href="add.jsp">课程信息录入</a>
 </div>
 <div class="a">
  <a href="CourseServlet?method=list">课程信息修改</a>
 </div>
 <div class="a">
  <a href="del.jsp">课程信息删除</a>
 </div>
 <div class="a">
  <a href="search.jsp">课程信息查询</a>
 </div>
 </div>
</body>
</html>

7、添加界面根据要求,增加判断课程名称不许重复,任课教师必须为五位的其中一个,上课地点开头为四个教室的一种。

<%@ page language="java" contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
 .a{
 margin-top: 20px;
 }
 .b{
 font-size: 20px;
 width: 160px;
 color: white;
 background-color: greenyellow;
 }
</style>
</head>
<body>
 <%
  Object message = request.getAttribute("message");
  if(message!=null && !"".equals(message)){
 
 %>
  <script type="text/javascript">
  alert("<%=request.getAttribute("message")%>");
  </script>
 <%} %>
 <div align="center">
 <h1 style="color: red;">课程信息录入</h1>
 <a href="index.jsp">返回主页</a>
 <form action="CourseServlet?method=add" method="post" onsubmit="return check()">
  <div class="a">
  课程名称<input type="text" id="name" name="name"/>
  </div>
  <div class="a">
  任课教师<input type="text" id="teacher" name="teacher" />
  </div>
  <div class="a">
  上课地点<input type="text" id="classroom" name="classroom" />
  </div>
  <div class="a">
  <button type="submit" class="b">保   存</button>
  </div>
 </form>
 </div>
 <script type="text/javascript">
                        
                        热心网友
                        时间:2022-04-10 17:04
                    

石家庄铁道大学工程管理还不错。

石家庄铁道大学(Shijiazhuang Tie University)简称"铁大"、“石铁大”,坐落于河北省省会石家庄市,河北省*与中华人民共和国教育部、国家国防科技工业局、国家铁路局四方共建的全国重点大学。

质量工程

截至2019年12月,学校有国家特色专业5个,国家综合改革试点专业2个,4个入选国家“卓越工程人才”计划专业。

1个国家人才培养模式创新实验区,1个国家级实验教学示范中心,7个国家级一流本科专业建设点,2门国家级精品资源共享课程,国家级大学生校外实践教育基地2项,国家级工程实践教育中心2项;获得河北省高校综合改革试点学院1个,为国家级研究生课程建设试点单位。

以上内容参考 百度百科-石家庄铁道大学

热心网友 时间:2022-04-10 18:22

我是石家庄铁道大学的,这个专业确实不适合男生学,但是,在我们学校学工管就对了,因为我们学校男生很好找工作,这个专业在我们学校一般吧!男生学这个工作绝对没问题的!宿舍情况:有四,六,八个人的三种宿舍,新生到校前已经分好了,所以你关心也没用,条件很一般,毕竟宿舍费便宜,习惯就好了!

热心网友 时间:2022-04-10 19:56

宿舍都差不多,条件一般不过住一段时间就习惯了。
工管是很不错的专业,这两年都是供不应求的,好多单位来了招不够工管的。
想转专业的话要考本专业前五名吧,也许是前三名。或者开学考试进入因材施教班。想进因材施教班的话现在赶紧开始复习数学英语吧!不过个人认为因材施教班不好,只适合考研的,这个班对于大学生活并不好,比较封闭,接触的朋友太少。

热心网友 时间:2022-04-10 21:48

哈哈,不错的,石家庄不错的学校
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
说课包括哪些方面 说课内容包括()。 如何在手机百度上删除对话记录? 结核病是什么样的疾病? 曹丕17岁得了肺痨,明知自己命不长久,还要强争王位,是不是很自私呢?_百... 古代小说常出现的病名 急求一篇"生活小窍门"(500字)的作文 至今最有什么小妙招 健康的戒烟方法 笔记本电池锁死是什么原因引起的? 手机微信来了信息,必须在打开软件时,才有提醒。离开微信软件后就没有提示音了? 为什么手泡在水里太久会皱皱的? 手机微信别人发来的消息,在实用别的APP时候,不提示消息,怎么设置成屏幕可以弹出消息? 手泡在水里久了为什么会变得皱皱的? 为什么手在水中泡久了会有许多皱纹? 长时间泡水后,为什么手指会出现褶皱? 被水侵泡后手指会起皱,这是为什么? 用手机登陆12306购票老说网络有问题而无法购票如何解决? 手指泡水后为什么会起皱? 三星手机5108q怎么用不了铁路12306购票软件 手机上如何使用铁友直接购票避开12306? 手长期浸泡在水里,为什么会变皱? 洗衣机内桶多少时间后清洗? 没有12306的账号可以买票吗?是用手机 手在水里泡久了之后,为什么会起皱? 手泡水会起皱是什么原理?和水温有关系吗? 12306是不是现在要手机验证后才能用手机买票啊?没有注册过12306的怎么办啊? 身份证因双户口注销,银行办业务能查到吗 我是双户,注销了网贷身份证号,用另外一个身份证号码查征信会查出来吗? 如何查询身份证是否出来? 仰角焊时要注意什么 ? 仰焊怎么焊?有什么技巧? 仰焊的运条方法 电焊仰焊的手法 傈僳话驽马卡什么意思 氩弧焊仰焊的手法 请问傈僳话爱人怎么说?可以用汉字写出来吗?谢谢。 电焊仰角焊用哪种方法好? 傈僳话然扒是什么 焊接仰角如何运条,焊条用什么角度 我爱你傈僳话怎么说 焊接仰焊接技术有什么好的方法?. 傈僳话真的不要我怎么说? 仰悍怎么悍啊 想你们了家人们有傈僳话怎么写? 仰角焊最好的运条方法是什么? 傈僳话依姑什么意思 焊条电弧焊立焊、仰焊、角度、以及运条方法怎么弄谢谢!中专生 我国世居民族数量最多的是( )省(自治区、市),有( )个民族 傈僳话怒玛卡什么意思