资源简介
用JSP页面做的学生作业管理系统,使用MYSQL数据库。供参考。
代码片段和文件信息
import javax.mail.*;
import javax.mail.internet.*;
import java.util.Properties;
import java.sql.*;
import java.util.*;
/**
* Program uses with cron to check every minutes if some users:
* --> Still do not have submit their assignement 1 day before the due date
* --> have passed the due date for their assignement
* in each case an email is send to those users
*/
public class MailAutoDuedatePassed {
/**
* The database‘s connection
*/
protected static Connection _con;
/**
* The database‘s location
*/
protected static String _source = “jdbc:mysql://127.0.0.1/test“;
/**
* The database‘s user
*/
protected static String _dbmUser = “root“;
/**
* The database‘s password
*/
protected static String _dbmPassword = “admin“;
/**
* The smtp server‘s host
*/
protected static String _smtpServerHost = “127.0.0.1“;
/**
* The user‘s login to connect to the smtp server
*/
protected static String _smtpUserLogin = ““;
/**
* The password to connect to the smtp server
*/
protected static String _smtpPassword = ““;
/**
* The author of the email
*/
protected static String _mailAuthor = “NotificationSystem@sixtwenty.com“;
/**
* The main program checking the two issues
*/
public static void main(String[] args) {
// Initialisation of the connection with the database
try {
Class.forName(“com.mysql.jdbc.Driver“).newInstance();
_con = DriverManager.getConnection(_source _dbmUser _dbmPassword);
//if (!_con.isClosed())
// System.out.println(“Connected to “ + _source);
} catch(Exception e) {
System.err.println(“Unable to connect to the database“);
System.exit(1);
}
Vector infoImpend = new Vector();
Vector infoLate = new Vector();
String subjectImpend = ““;
String subjectLate = ““;
String contentImpend = ““;
String contentLate = ““;
checkDuedateImpend(infoImpend);
checkDuedatePassed(infoLate);
// Send all the emails for the impending projects
for (int i = 0; i < infoImpend.size(); i++) {
subjectImpend = “Project “ + infoImpend.elementAt(i).getProjectName()+ “ due date is impending“;
contentImpend = “Dear “ + infoImpend.elementAt(i).getUserName() + “\n\n“;
contentImpend = contentImpend + “The project “ + infoImpend.elementAt(i).getProjectName() + “(“ + infoImpend.elementAt(i).getProjectId() + “)“;
contentImpend = contentImpend + “ due date is impending.\nYou have now one day to submit your submission.“;
contentImpend = contentImpend + “\n\nPlease do not reply to this automatically send email.“;
try {
send(subjectImpend
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7801 2006-10-30 10:48 grp-e\db\createDb.sql
目录 0 2008-07-05 09:42 grp-e\db
文件 748 2006-10-30 10:48 grp-e\docs\definitions-list.html
文件 3497 2006-10-30 10:48 grp-e\docs\help-doc.html
文件 799 2006-10-30 10:48 grp-e\docs\index.html
文件 8362 2006-10-30 10:48 grp-e\docs\navbar.html
文件 4485 2006-10-30 10:48 grp-e\docs\operation-index.html
文件 937 2006-10-30 10:48 grp-e\docs\overview-summary.html
文件 1163 2006-10-30 10:48 grp-e\docs\st
文件 4554 2006-10-30 10:48 grp-e\docs\subelement-list.html
文件 1893 2006-10-30 10:48 grp-e\docs\submit\accessLevelRequest-message.html
文件 1930 2006-10-30 10:48 grp-e\docs\submit\accessLevelResponse-message.html
文件 4023 2006-10-30 10:48 grp-e\docs\submit\addProjectRequest-message.html
文件 1925 2006-10-30 10:48 grp-e\docs\submit\addProjectResponse-message.html
文件 2790 2006-10-30 10:48 grp-e\docs\submit\addSubmissionRequest-message.html
文件 1949 2006-10-30 10:48 grp-e\docs\submit\addSubmissionResponse-message.html
文件 2335 2006-10-30 10:48 grp-e\docs\submit\authenticateUserRequest-message.html
文件 1974 2006-10-30 10:48 grp-e\docs\submit\authenticateUserResponse-message.html
文件 1901 2006-10-30 10:48 grp-e\docs\submit\getProjectByIDRequest-message.html
文件 1961 2006-10-30 10:48 grp-e\docs\submit\getProjectByIDResponse-message.html
文件 1483 2006-10-30 10:48 grp-e\docs\submit\getProjectListRequest-message.html
文件 1968 2006-10-30 10:48 grp-e\docs\submit\getProjectListResponse-message.html
文件 3147 2006-10-30 10:48 grp-e\docs\submit\getProjectRequest-message.html
文件 1929 2006-10-30 10:48 grp-e\docs\submit\getProjectResponse-message.html
文件 1909 2006-10-30 10:48 grp-e\docs\submit\getProjectStatusRequest-message.html
文件 1973 2006-10-30 10:48 grp-e\docs\submit\getProjectStatusResponse-message.html
文件 1929 2006-10-30 10:48 grp-e\docs\submit\getProjectSubmissionsRequest-message.html
文件 2027 2006-10-30 10:48 grp-e\docs\submit\getProjectSubmissionsResponse-message.html
文件 1917 2006-10-30 10:48 grp-e\docs\submit\getSubmissionListRequest-message.html
文件 1995 2006-10-30 10:48 grp-e\docs\submit\getSubmissionListResponse-message.html
............此处省略128个文件信息
相关资源
- 在线选课系统 java servlet+ jsp+mysql+css
- 基于jsp写的购物车系统
- jsp实现用户的注册并连接数据库将注
- JSP购物车
- java+jquery文件上传 无刷新 带进度条,
- standard的jar包
- 漂亮的jsp登录界面
- Servlet+Jsp+MySql用户登录实例224192
- 后台管理系统模版jsp页面版
- servlet+jsp的购物车案例
- JavaWeb最简单粗暴的简单登录及数据库
- jsp.rar
- (JSP)公交车线路查询系统
- Head First_深入浅出Servlets&JSP;(中文第
- jsp+servlet+javabean jdbc连接数据库 用户登
- 基于数据库的网上购物书店
- 基于jsp和Oracle的网上商店
- JSP+MySql实现的网络在线投票系统
- java web 网上商城项目源码(jspservlet
- java网上商城项目源码jsp.servlet+javabe
- JSP-论坛管理系统
- jsp 实现球员管理
- Java+servlet+jsp页面ajax请求
- JAVA学生选课系统jsp源代码
- 小型图书管理系统jsp+javabean+servlet+s
- MODEL 2 的登录功能实现 servlet+jsp+java
- 57977JSP+MSSQL在线贷款借款网站的设计与
- JSP应用框架外文翻译
- 计算机专业外文翻译(JSP技术简介及
- 网站开发界面模板
评论
共有 条评论