当前位置:首页 » 编程语言 » javasql学生管理系统

javasql学生管理系统

发布时间: 2022-08-22 21:31:56

⑴ 急求 java学生信息管理系统+sql 的 基于java窗口的

仅仅给你个参考//JavaGroupProject_StudentManagement源码//NetBeansIDE6.5环境packagestudentmanager;importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjava.io.*;importjava.util.*;classStudentimplementsjava.io.Serializable{Stringnumber,name,specialty,grade,borth,sex;publicStudent(){};publicvoidsetNumber(Stringnumber){this.number=number;}publicStringgetNumber(){returnnumber;}publicvoidsetName(Stringname){this.name=name;}publicStringgetName(){returnname;}publicvoidsetSex(Stringsex){this.sex=sex;}publicStringgetSex(){returnsex;}publicvoidsetSpecialty(Stringspecialty){this.specialty=specialty;}publicStringgetSpecialty(){returnspecialty;}publicvoidsetGrade(Stringgrade){this.grade=grade;}publicStringgetGrade(){returngrade;}publicvoidsetBorth(Stringborth){this.borth=borth;}publicStringgetBorth(){returnborth;}}{JLabellb=newJLabel("录入请先输入记录,查询、删除请先输入学号,修改是对查询"+"内容改后的保存!");JTextField学号,姓名,专业,年级,出生;JRadioButton男,女;ButtonGroupgroup=null;JButton录入,查询,删除,修改,显示;JPanelp1,p2,p3,p4,p5,p6,pv,ph;Student学生=null;Hashtable学生散列表=null;Filefile=null;FileInputStreaminOne=null;ObjectInputStreaminTwo=null;FileOutputStreamoutOne=null;ObjectOutputStreamoutTwo=null;publicStudentManager(){super("学生基本信息管理系统");学号=newJTextField(10);姓名=newJTextField(10);专业=newJTextField(10);年级=newJTextField(10);出生=newJTextField(10);group=newButtonGroup();男=newJRadioButton("男",true);女=newJRadioButton("女",false);group.add(男);group.add(女);录入=newJButton("录入");查询=newJButton("查询");删除=newJButton("删除");修改=newJButton("修改");显示=newJButton("显示");录入.addActionListener(newInputAct());查询.addActionListener(newInquestAct());修改.addActionListener(newModifyAct());删除.addActionListener(newDeleteAct());显示.addActionListener(newShowAct());修改.setEnabled(false);p1=newJPanel();p1.add(newJLabel("学号:",JLabel.CENTER));p1.add(学号);p2=newJPanel();p2.add(newJLabel("姓名:",JLabel.CENTER));p2.add(姓名);p3=newJPanel();p3.add(newJLabel("性别:",JLabel.CENTER));p3.add(男);p3.add(女);p4=newJPanel();p4.add(newJLabel("专业:",JLabel.CENTER));p4.add(专业);p5=newJPanel();p5.add(newJLabel("年级:",JLabel.CENTER));p5.add(年级);p6=newJPanel();p6.add(newJLabel("出生:",JLabel.CENTER));p6.add(出生);pv=newJPanel();pv.setLayout(newGridLayout(6,1));pv.add(p1);pv.add(p2);pv.add(p3);pv.add(p4);pv.add(p5);pv.add(p6);ph=newJPanel();ph.add(录入);ph.add(查询);ph.add(修改);ph.add(删除);ph.add(显示);file=newFile("学生信息.txt");学生散列表=newHashtable();if(!file.exists()){try{FileOutputStreamout=newFileOutputStream(file);ObjectOutputStreamobjectOut=newObjectOutputStream(out);objectOut.writeObject(学生散列表);objectOut.close();out.close();}catch(IOExceptione){}}Containercon=getContentPane();con.setLayout(newBorderLayout());con.add(lb,BorderLayout.NORTH);con.add(pv,BorderLayout.CENTER);con.add(ph,BorderLayout.SOUTH);setDefaultCloseOperation(EXIT_ON_CLOSE);setBounds(100,100,600,300);setVisible(true);}publicstaticvoidmain(String[]args){newStudentManager();}{publicvoidactionPerformed(ActionEvente){修改.setEnabled(false);Stringnumber="";number=学号.getText();if(number.length()>0){try{inOne=newFileInputStream(file);inTwo=newObjectInputStream(inOne);学生散列表=(Hashtable)inTwo.readObject();inOne.close();inTwo.close();}catch(Exceptionee){System.out.println("创建散列表出现问题!");}if(学生散列表.containsKey(number)){Stringwarning="该生信息已存在,请到修改页面修改!";JOptionPane.showMessageDialog(null,warning,"警告",JOptionPane.WARNING_MESSAGE);}//endif1else{Stringm="该生信息将被录入!";intok=JOptionPane.showConfirmDialog(null,m,"确认",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);if(ok==JOptionPane.YES_OPTION){Stringname=姓名.getText();Stringspecialty=专业.getText();Stringgrade=年级.getText();Stringborth=出生.getText();Stringsex=null;if(男.isSelected()){sex=男.getText();}else{sex=女.getText();}学生=newStudent();学生.setNumber(number);学生.setName(name);学生.setSpecialty(specialty);学生.setGrade(grade);学生.setBorth(borth);学生.setSex(sex);try{outOne=newFileOutputStream(file);outTwo=newObjectOutputStream(outOne);学生散列表.put(number,学生);outTwo.writeObject(学生散列表);outTwo.close();outOne.close();}catch(Exceptionee){System.out.println("输出散列表出现问题!");}学号.setText(null);姓名.setText(null);专业.setText(null);年级.setText(null);出生.setText(null);}}//endelse1}//endif0else{Stringwarning="必须输入学号!";JOptionPane.showMessageDialog(null,warning,"警告",JOptionPane.WARNING_MESSAGE);}//endelse0}//endactionPerformed}//{publicvoidactionPerformed(ActionEvente){Stringnumber="";number=学号.getText();if(number.length()>0){try{inOne=newFileInputStream(file);inTwo=newObjectInputStream(inOne);学生散列表=(Hashtable)inTwo.readObject();inOne.close();inTwo.close();}catch(Exceptionee){System.out.println("散列表有问题!");}if(学生散列表.containsKey(number)){修改.setEnabled(true);Studentstu=(Student)学生散列表.get(number);姓名.setText(stu.getName());专业.setText(stu.getSpecialty());年级.setText(stu.getGrade());出生.setText(stu.getBorth());if(stu.getSex().equals("男")){男.setSelected(true);}else{女.setSelected(true);}}else{修改.setEnabled(false);Stringwarning="该学号不存在!";JOptionPane.showMessageDialog(null,warning,"警告",JOptionPane.WARNING_MESSAGE);}}else{修改.setEnabled(false);Stringwarning="必须输入学号!";JOptionPane.showMessageDialog(null,warning,"警告",JOptionPane.WARNING_MESSAGE);}}}{publicvoidactionPerformed(ActionEvente){Stringnumber=学号.getText();Stringname=姓名.getText();Stringspecialty=专业.getText();Stringgrade=年级.getText();Stringborth=出生.getText();Stringsex=null;if(男.isSelected()){sex=男.getText();}else{sex=女.getText();}Student学生=newStudent();学生.setNumber(number);学生.setName(name);学生.setSpecialty(specialty);学生.setGrade(grade);学生.setBorth(borth);学生.setSex(sex);try{outOne=newFileOutputStream(file);outTwo=newObjectOutputStream(outOne);学生散列表.put(number,学生);outTwo.writeObject(学生散列表);outTwo.close();outOne.close();学号.setText(null);姓名.setText(null);专业.setText(null);年级.setText(null);出生.setText(null);}catch(Exceptionee){System.out.println("录入修改出现异常!");修改.setEnabled(false);}}}{publicvoidactionPerformed(ActionEvente){修改.setEnabled(false);Stringnumber=学号.getText();if(number.length()>0){try{inOne=newFileInputStream(file);inTwo=newObjectInputStream(inOne);学生散列表=(Hashtable)inTwo.readObject();inOne.close();inTwo.close();}catch(Exceptionee){}if(学生散列表.containsKey(number)){Studentstu=(Student)学生散列表.get(number);姓名.setText(stu.getName());专业.setText(stu.getSpecialty());年级.setText(stu.getGrade());出生.setText(stu.getBorth());if(stu.getSex().equals("男")){男.setSelected(true);}else{女.setSelected(true);}}Stringm="确定要删除该学生的记录吗?";intok=JOptionPane.showConfirmDialog(null,m,"确认",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);if(ok==JOptionPane.YES_OPTION){学生散列表.remove(number);try{outOne=newFileOutputStream(file);outTwo=newObjectOutputStream(outOne);outTwo.writeObject(学生散列表);outTwo.close();outOne.close();学号.setText(null);姓名.setText(null);专业.setText(null);年级.setText(null);出生.setText(null);}catch(Exceptionee){System.out.println(ee);}}elseif(ok==JOptionPane.NO_OPTION){学号.setText(null);姓名.setText(null);专业.setText(null);年级.setText(null);出生.setText(null);}else{Stringwarning="该学号不存在!";JOptionPane.showMessageDialog(null,warning,"警告",JOptionPane.WARNING_MESSAGE);}}else{Stringwarning="必须输入学号!";JOptionPane.showMessageDialog(null,warning,"警告",JOptionPane.WARNING_MESSAGE);}}}{publicvoidactionPerformed(ActionEvente){newStudentShow(file);}}{Hashtable学生散列表=null;JTextArea显示=null;FileInputStreaminOne=null;ObjectInputStreaminTwo=null;Filefile=null;publicStudentShow(Filefile){super(newJFrame(),"显示对话框");this.file=file;显示=newJTextArea(16,30);try{inOne=newFileInputStream(file);inTwo=newObjectInputStream(inOne);学生散列表=(Hashtable)inTwo.readObject();inOne.close();inTwo.close();}catch(Exceptionee){}if(学生散列表.isEmpty())显示.append("目前还没有学生的信息记录!\n");else{显示.setText("学号姓名性别专业年级出生\n");for(Enumerationenm=学生散列表.elements();enm.hasMoreElements();){Studentstu=(Student)enm.nextElement();Stringsex="";if(stu.getSex().equals("男"))sex="男";elsesex="女";Stringstr=stu.getNumber()+","+stu.getName()+","+sex+","+stu.getSpecialty()+","+stu.getGrade()+","+stu.getBorth()+"\n";显示.append(str);}}JScrollPanescroll=newJScrollPane(显示);Containercon=getContentPane();con.add("Center",scroll);con.validate();setVisible(true);setBounds(200,200,400,300);addWindowListener(newWindowAdapter(){publicvoidwindowClosing(WindowEvente){setVisible(false);}});}}}

⑵ 怎样用java和sql来做一个学生管理系统

关于介绍做系统的书是很少的,大部分书都是介绍基础知识,建议从网上down一个学生管理系统的源代码,然后看别人怎么做的,自己再学着做。
要看书的话,两本就够了,一本Java基础,一本SQL基础,具体书目,随便,因为介绍基础的书都差不多

⑶ 如何用java制作学生管理系统

是要小型的还是大型的 小型的 需要数据库吗?下面这是个 控制台输出的

importjava.util.List;
importjava.util.Scanner;

importcn.com.shxt.DBUtils.JdbcTool;

publicclassStudentManager{
/*
1.学生信息管理系统,界面如下
1--学生信息添加
2--全部学生信息查询
3--查询录取学生的信息
4--按学号查询录取学生的信息
5--按姓名查询录取学生的信息
6--退出

*/
publicstaticvoidmain(String[]args){
Scannerscan=newScanner(System.in);
JdbcTooljt=newJdbcTool();
List<List<String>>tableList;
intflag;
Stringno;
Stringname;
Stringmain;
Stringpolitics;
StringEnglish;
StringMath;
StringMajor;
StringTotal;
Stringsql;
booleanpanan=true;
while(panan){
System.out.println();
System.out.println("===========欢迎进入研究生录取系统================");
System.out.println("1--学生信息添加");
System.out.println("2--录入学生信息查询");
System.out.println("3--查询录取学生的信息");
System.out.println("4--按学号查询录取学生的信息");
System.out.println("5--按姓名查询录取学生的信息");
System.out.println("0--退出");
System.out.println("请输入序号,选择功能");
flag=scan.nextInt();
switch(flag){
case1:
System.out.println("请输入学生的学号、姓名、报考专业、政治、英语、高数、专业课分数");
no=scan.next();
name=scan.next();
main=scan.next();
politics=scan.next();
English=scan.next();
Math=scan.next();
Major=scan.next();
inttotal=0;
total=Integer.parseInt(politics)+Integer.parseInt(English)+Integer.parseInt(Math)+Integer.parseInt(Major);
sql="insertintostumanager(s_no,s_name,s_main,s_politics,s_English,s_Math,s_Major,s_Total)values('"+no+"','"+name+"','"+main+"',"+politics+",'"+English+"','"+Math+"','"+Major+"','"+total+"')";
jt.update(sql);
System.out.println("添加成功");
break;
case2:
sql="select*fromstumanagerorderbys_totaldesc";
tableList=jt.query(sql);
if(tableList!=null&&tableList.size()>0){
tableList=jt.query(sql);
for(List<String>rowList:tableList){
System.out.println("id 学号 姓名 专业 政治 英语 高数 专业 总分 ");
System.out.println(rowList.get(0)+" "+rowList.get(1)+" "+rowList.get(2)+" "+rowList.get(3)+" "+rowList.get(4)+" "+rowList.get(5)+" "+rowList.get(6)+" "+rowList.get(7)+" "+rowList.get(8));
}
}else{
System.out.println("没有学生信息,请添加~~");
break;
}
break;
case3:
System.out.println("请输入报考专业以及政治、英语、高数、专业课、总分的分数");
main=scan.next();
politics=scan.next();
English=scan.next();
Math=scan.next();
Major=scan.next();
Total=scan.next();
sql="select*fromstumanagerwheres_main='"+main+"'ands_politics>="+politics+"ands_English>="+English+"ands_Math>="+Math+"ands_Major>="+Major+"ands_Total>="+Total+"";
tableList=jt.query(sql);
if(tableList.size()!=0){
tableList=jt.query(sql);
for(List<String>rowList:tableList){
System.out.println("id 学号 姓名 专业 政治 英语 高数 专业 总分 ");
System.out.println(rowList.get(0)+" "+rowList.get(1)+" "+rowList.get(2)+" "+rowList.get(3)+" "+rowList.get(4)+" "+rowList.get(5)+" "+rowList.get(6)+" "+rowList.get(7)+" "+rowList.get(8));
System.out.println("恭喜你,你被录取了");
}
}else{
System.out.println("抱歉,你没有被录取");
break;
}
break;
case4:
System.out.println("请输入要查询的学生的学号以及政治、英语、高数、专业课、总分的录取分数");
no=scan.next();
politics=scan.next();
English=scan.next();
Math=scan.next();
Major=scan.next();
Total=scan.next();
System.out.println("此学生的信息:");
sql="select*fromstumanagerwheres_politics>="+politics+"ands_English>="+English+"ands_Math>="+Math+"ands_Major>="+Major+"ands_Total>="+Total+"ands_no="+no+"";
tableList=jt.query(sql);
if(tableList!=null&&tableList.size()>0){
tableList=jt.query(sql);
for(List<String>rowList:tableList){
System.out.println("id 学号 姓名 专业 政治 英语 高数 专业 总分 ");
System.out.println(rowList.get(0)+" "+rowList.get(1)+" "+rowList.get(2)+" "+rowList.get(3)+" "+rowList.get(4)+" "+rowList.get(5)+" "+rowList.get(6)+" "+rowList.get(7)+" "+rowList.get(8));
System.out.println("恭喜你,你被录取了");
}
}else{
System.out.println("抱歉,你没有被录取");
break;
}
break;
case5:
System.out.println("请输入要查询的学生姓名(单个文字也可)以及政治、英语、高数、专业课、总分的录取分数");
name=scan.next();
politics=scan.next();
English=scan.next();
Math=scan.next();
Major=scan.next();
Total=scan.next();
sql="select*fromstumanagerwheres_politics>="+politics+"ands_English>="+English+"ands_Math>="+Math+"ands_Major>="+Major+"ands_Total>="+Total+"ands_namelike'%"+name+"%'";
tableList=jt.query(sql);
if(tableList!=null&&tableList.size()>0){
tableList=jt.query(sql);
for(List<String>rowList:tableList){
System.out.println("id 学号 姓名 专业 政治 英语 高数 专业 总分 ");
System.out.println(rowList.get(0)+" "+rowList.get(1)+" "+rowList.get(2)+" "+rowList.get(3)+" "+rowList.get(4)+" "+rowList.get(5)+" "+rowList.get(6)+" "+rowList.get(7)+" "+rowList.get(8));
System.out.println("恭喜你,你被录取了");
}
}else{
System.out.println("抱歉,你没有被录取");
break;
}
break;
case0:
panan=false;
break;

}

}
}
}

⑷ 怎么用java+sql数据库做一个学生信息管理系统

Student 类
public class Student
{
private int id;

private int age;

private int score;

private String name;

public Student()
{

}

public Student(int id, int age, int score, String name)
{
this.id = id;
this.age = age;
this.score = score;
this.name = name;
}

public int getId()
{
return id;
}

public void setId(int id)
{
this.id = id;
}

public int getAge()
{
return age;
}

public void setAge(int age)
{
this.age = age;
}

public int getScore()
{
return score;
}

public void setScore(int score)
{
this.score = score;
}

public String getName()
{
return name;
}

public void setName(String name)
{
this.name = name;
}

@Override
public String toString()
{
return "学号:" + id + " 姓名:" + name + " 年龄:" + age + " 成绩:" + score;
}
}

Manager类
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Manager
{
private List<Student> list;

public Manager(List<Student> list)
{
this.list = list;
}

public List<Student> getList()
{
return list;
}

public void setList(List<Student> list)
{
this.list = list;
}

//添加学生
public void add(Student s)
{
list.add(s);
}

//根据学生学号返回学生年龄
public int search(int id)
{
for(Iterator<Student> iter = list.iterator(); iter.hasNext();)
{
Student s = iter.next();

if(s.getId() == id)
{
return s.getAge();
}
}
return -1;
}

//删除学生
public void remove(int id)
{
for(Iterator<Student> iter = list.iterator(); iter.hasNext();)
{
Student s = iter.next();

if(s.getId() == id)
{
list.remove(s);
}
}
}

//计算总成绩
public int allScore()
{
int score = 0;
int temp = 0;

for(Iterator<Student> iter = list.iterator(); iter.hasNext();)
{
Student s = iter.next();

temp = s.getScore();

score += temp;
}

return score;
}

//修改成绩
public void update(int id)
{
for(Iterator<Student> iter = list.iterator(); iter.hasNext();)
{
Student s = iter.next();

if(s.getId() == id)
{
s.setScore(s.getScore() + 10);
}
}
}
}

测试类 Client
import java.util.ArrayList;
import java.util.List;

public class Client
{
public static void main(String[] args)
{
List<Student> list = new ArrayList<Student>();

Manager manager = new Manager(list);//创建一个管理者

Student s1 = new Student();//无参构造方法创建的学生实例

//通过方法设置s1的属性
s1.setId(201105);
s1.setAge(20);
s1.setScore(100);
s1.setName("zhangsan");

Student s2 = new Student(201101,21,98,"lisi");//通过带参数的构造方法创建实例
Student s3 = new Student(201108,25,95,"zhaoliu");
Student s4 = new Student(201110,23,80,"xiaoming");
Student s5 = new Student(201106,28,78,"hello");

//放到集合当中
manager.getList().add(s1);//添加学生
manager.getList().add(s2);
manager.getList().add(s3);
manager.getList().add(s4);
manager.getList().add(s5);

System.out.println(list);

System.out.println(manager.allScore());

System.out.println(manager.search(201110));//根据学生学号查询学生年龄

manager.remove(201110);//删除学生

manager.update(201101);//修改成绩

}
}
可以完成你上述的基本要求,如果改动可以自行修改 很简单。

⑸ 哪位高手能帮忙做个JAVA+SQL的学生信息管理系统

只有管理员登陆的!
链接数据库:
package score.db;

import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

public class DBUtil {
//加载驱动
private static String driverName=null;
private static String connUrl=null;
private static String user=null;
private static String password=null;
private static Connection conn=null;
private static ResultSet rs=null;
private static Statement stm=null;
static
{
InputStream ips=null;
try
{
ips=DBUtil.class.getResourceAsStream("DBConfig.properties");
Properties prop=new Properties();
prop.load(ips);
driverName=prop.getProperty("driverName");
connUrl=prop.getProperty("connUrl");
user=prop.getProperty("user");
password=prop.getProperty("password");
System.out.println("start to SQL driver");
ips.close();
}catch(Exception e)
{
e.getStackTrace();
}
finally
{
if(ips!=null)
{
try
{
ips.close();
}catch(Exception e)
{
ips=null;
}
}
}
}
//获取数据库连接
public static Connection getConnection() throws ClassNotFoundException, SQLException
{

Class.forName(driverName);
conn=DriverManager.getConnection(connUrl,user,password);
return conn;
}
//数据查询
public static ResultSet queryData(String sql) throws ClassNotFoundException
{
Statement stm=null;
try
{
conn=getConnection();
stm=conn.createStatement();
rs=stm.executeQuery(sql);
}catch(SQLException e)
{
e.printStackTrace();
}
return rs;
}
// 数据更新
public static int Update(String sql) throws ClassNotFoundException
{ int a=0;
try {
conn=getConnection();
stm=conn.createStatement();
a=stm.executeUpdate(sql);
} catch (SQLException e) {

e.printStackTrace();
}
return a;
}
//关闭数据库
public static void closeConnection()
{
if(rs!=null)
{
try {
rs.close();
} catch (SQLException e) {
rs=null;
}
}
if(stm!=null)
{
try {
stm.close();
} catch (SQLException e) {
stm=null;
}
}
if(conn!=null)
{
try {
conn.close();
} catch (SQLException e) {
conn=null;
}
}
}
}
JAVABEAN:
package score.bean;

public class userInfoBean {
String userCode;
String userPwd;
String userFlag;
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserPwd() {
return userPwd;
}
public void setUserPwd(String userPwd) {
this.userPwd = userPwd;
}
public String getUserFlag() {
return userFlag;
}
public void setUserFlag(String userFlag) {
this.userFlag = userFlag;
}

}
登陆Login:
package score.java;

import java.sql.Connection;
import java.sql.ResultSet;

import score.db.DBUtil;

public class Login {
//登陆方法
public String login(String userpwd,String userCode)
{
Connection conn=null;
ResultSet rs=null;
String userflag=null;
String pwd=null;
System.out.println("test1");
//加载数据库
DBUtil db=new DBUtil();
try
{
conn=db.getConnection();
System.out.println("test2");
String sql="select userPwd,userFlag from tab_user where userCode='"+userCode+"'";
rs=db.queryData(sql);
while(rs.next())
{
pwd=rs.getString("userPwd");
userflag=rs.getString("userFlag");
}
db.closeConnection();
}catch(Exception e){}

if(userpwd.equals(pwd)&&userflag.equals("M"))
return "M";
else if(userpwd.equals(pwd)&&userflag.equals("T"))
return "T";
else if(userpwd.equals(pwd)&&userflag.equals("S"))
return "S";
else return "E";

}

}
LoginServlet:
package score.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;

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

import score.db.DBUtil;
import score.java.Login;

public class LoginServlet extends HttpServlet {

public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

response.setContentType("text/html;charset=GBK");
request.setCharacterEncoding("GBK");
//获取表单信息
String usercode=request.getParameter("userCode");
String userpwd=request.getParameter("userPwd");
System.out.println("xxx");
//创建业务类Login的一个对象
Login login=new Login();
//转发跳转
if(login.login(userpwd,usercode).equals("M"))
{
getServletContext().getRequestDispatcher("/manager/Manage.jsp").forward(request, response);
}
else if(login.login(userpwd,usercode).equals("S"))
{
getServletContext().getRequestDispatcher("/student/stuManage.jsp").forward(request, response);
}
else if(login.login(userpwd,usercode).equals("T"))
{
getServletContext().getRequestDispatcher("/teacher/teaManage.jsp").forward(request, response);
}
}

}

⑹ 临近毕业,用java做了个学生信息管理系统,需要用到sql数据库,请问怎么连接,急用,谢谢各位

package test;

import java.sql.*;

import cn.com.sdata.util.SDGetConnection;

/**
*
* @author user
*mssql数据库连接操作
*/
public class MssqlConnTest {
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //加载JDBC驱动
String dbURL = "jdbc:sqlserver://127.0.0.1:1433; DatabaseName=test"; //连接服务器和数据库sample
String userName = "sa"; //默认用户名
String userPwd = "000000"; //密码
Connection dbConn;
public Connection getConnection()
{
try
{

Class.forName(driverName);
dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
System.out.println("Connection Successful!"); //如果连接成功 控制台输出Connection Successful!
return dbConn;
} catch (Exception e)
{
e.printStackTrace();
}
return null;
}
public void closeConnection()
{
try {
dbConn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] srg)
{

// DBConnectionManager DBConnectionManager1 = new DBConnectionManager();
try
{
System.out.println("success");
MssqlConnTest test = new MssqlConnTest();
Connection conn = test.getConnection();
System.out.println("Connection Successful!"); //如果连接成功 控制台输出Connection Successful!
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select top 1 * from DOI");
while(rs.next())
{
System.out.print("\tfirst: "+rs.getString(1));
System.out.print("\tsecond: "+rs.getString(2));
}
//*/
}catch(Exception e)
{
e.printStackTrace();
}
}
}

⑺ 用java做一个学生成绩管理系统需要哪些技术

用java做一个学生成绩管理系统,可以用到如下技术:
后台:ssh框架,不用框架的话,单纯地用jsp
+
servlet也可以。
前台:html
+
css
+
js
+
jquery
数据库:掌握sql语言的编写,数据库的连接。复杂的项目还需要用到存储过程。

热点内容
md5加密后的密码是什么意思 发布:2025-01-18 15:50:16 浏览:192
如何qq空间访问权限 发布:2025-01-18 15:49:30 浏览:531
matlab遗传算法约束 发布:2025-01-18 15:31:33 浏览:909
果冻java 发布:2025-01-18 15:25:59 浏览:695
电脑与时间服务器同步间隔 发布:2025-01-18 15:21:28 浏览:54
苹果手机apple登录密码在手机哪里 发布:2025-01-18 15:13:43 浏览:380
吃鸡去哪里下手游安卓 发布:2025-01-18 15:10:59 浏览:668
东方财富dk指标源码 发布:2025-01-18 14:45:53 浏览:435
陌陌登陆密码是什么 发布:2025-01-18 14:36:54 浏览:848
海龟编译器代码 发布:2025-01-18 14:16:51 浏览:34