资源简介

该针对网站登录流程的实例,详细叙述登录过程的实现。环境:myeclipse+mysql。具体阐述见http://write.blog.csdn.net/postlist

资源截图

代码片段和文件信息

package javacode;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Connectionhelper 
{
public static Connection getConnection()
{
String driver = “com.mysql.jdbc.Driver“;
String url = “jdbc:mysql://127.0.0.1:3306/testjs“;
String user = “root“;
String password = “admin“;
Connection conn = null;
try {
Class.forName(driver);
conn = DriverManager.getConnection(url user password);
if (!conn.isClosed())
System.out.println(“Succeeded connecting to the Database!“);
} catch (ClassNotFoundException e) {
System.out.println(“Sorrycan‘t find the Driver!“);
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         779  2014-03-06 17:54  ChatRoom\.classpath
     目录           0  2014-03-06 20:24  ChatRoom\.myeclipse\
     文件         297  2014-03-06 14:32  ChatRoom\.mymetadata
     文件        1751  2014-03-06 16:07  ChatRoom\.project
     文件         500  2014-03-06 14:32  ChatRoom\.settings\.jsdtscope
     文件         395  2014-03-06 14:32  ChatRoom\.settings\org.eclipse.jdt.core.prefs
     文件         462  2014-03-06 14:32  ChatRoom\.settings\org.eclipse.wst.common.component
     文件         252  2014-03-06 14:32  ChatRoom\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2014-03-06 14:32  ChatRoom\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2014-03-06 14:32  ChatRoom\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          36  2014-03-06 14:31  ChatRoom\WebRoot\meta-INF\MANIFEST.MF
     文件        1468  2014-03-06 18:46  ChatRoom\WebRoot\WEB-INF\classes\javacode\Connectionhelper.class
     文件        2444  2014-03-06 18:46  ChatRoom\WebRoot\WEB-INF\classes\javacode\LoginHandle.class
     文件        2083  2014-03-06 18:46  ChatRoom\WebRoot\WEB-INF\classes\servlet\ChatServlet.class
     文件        1643  2014-03-06 20:08  ChatRoom\WebRoot\WEB-INF\classes\servlet\LoginServlet.class
     目录           0  2014-03-06 20:24  ChatRoom\WebRoot\WEB-INF\lib\
     文件        1262  2014-03-06 16:40  ChatRoom\WebRoot\WEB-INF\web.xml
     文件         834  2014-03-06 14:31  ChatRoom\WebRoot\index.jsp
     文件       78601  2014-03-06 15:06  ChatRoom\WebRoot\js\jquery-1.4.4.min.js
     文件       30330  2014-03-06 15:17  ChatRoom\WebRoot\js\jquery.form.js
     文件      129738  2014-03-06 15:07  ChatRoom\WebRoot\js\prototype-1.6.0.3.js
     文件        1478  2014-03-06 19:55  ChatRoom\WebRoot\login.html
     文件         823  2014-03-06 16:06  ChatRoom\src\javacode\Connectionhelper.java
     文件        1713  2014-03-06 18:20  ChatRoom\src\javacode\LoginHandle.java
     文件        2943  2014-03-06 14:34  ChatRoom\src\servlet\ChatServlet.java
     文件        1202  2014-03-06 20:08  ChatRoom\src\servlet\LoginServlet.java

评论

共有 条评论