record.java

来自「一个JAVA的学生管理系统,用的是GUI的图形用户界面.」· Java 代码 · 共 49 行

JAVA
49
字号
import java.sql.*;




/////////////////开始的入口处在pp2







class Record{
	Connection con=null;
	Statement s=null;
	public static void main(String args[])throws Exception{
		Record record=new Record();
	}
	void Connect()throws Exception{
		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		con=DriverManager.getConnection("jdbc:odbc:Record");
		s=con.createStatement();
	}
	void Closed()throws Exception{
		s.close();
		con.close();
	}
	void Success(){
		System.out.println("record success");
	}
	void NoSuccess(){
		System.out.println("record nosuccess");
	}
	void LoadRecord(String time,String id)throws Exception{
		this.Connect();
		String query="insert into Record values(";
		query+="'"+time+"',";
		query+="'"+id+"')";
		try{
			s.executeUpdate(query);
			this.Success();
		}catch(Exception e){
			this.NoSuccess();
		}
		this.Closed();
	}
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?