資源簡介
jsp的課程設計,使用了jsp + mysql 的 mvc 模式開發,可以根據不同的登錄權限進行話題增加、投票、查看投票結果,根據ip限定只能對一個投票話題投票一次

代碼片段和文件信息
/*
??*?JDBCHelloWorld.java
??*?版權所有?2007?劉長炯(BeanSoft@126.com)
??*?Blog:?http://www.blogjava.net/beansoft/
??*?本代碼協議:?GPL?參考根目錄下的?gpl.txt
??*/
import?java.sql.SQLException;
/**
?*?第一個?JDBC?的?HelloWorld?程序?數據庫訪問?Mysql.
?*?@author?BeanSoft@126.com
?*?@version?0.2?2007-10-01
?*/
public?class?JDBCHelloWorld?{
/**
?*?@param?args
?*?@throws?SQLException?
?*/
public?static?void?main(String[]?args)?throws?SQLException?{
//?1.?注冊驅動
try?{
Class.forName(“com.mysql.jdbc.Driver“);
}?catch?(ClassNotFoundException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}//?Mysql?的驅動
//?2.?獲取數據庫的連接
java.sql.Connection?conn?=?java.sql.DriverManager.getConnection(
“jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=GBK“?“root“?null);
//?3.?獲取表達式
java.sql.Statement?stmt?=?conn.createStatement();
//?執行插入數據的?SQL
stmt.executeUpdate(“insert?into?MyUser(username?password)?values(‘JDBC?中文測試‘?‘密碼‘)“);
//?4.?執行?SQL
java.sql.ResultSet?rs?=?stmt.executeQuery(“select?*?from?MyUser“);
//?5.?顯示結果集里面的數據
while(rs.next())?{
System.out.println(rs.getInt(1));
System.out.println(rs.getString(“username“));
System.out.println(rs.getString(“password“));
System.out.println();
}
//?6.?釋放資源
rs.close();
stmt.close();
conn.close();
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????613??2010-06-09?00:34??voteWeb\.classpath
?????文件????????294??2010-06-18?13:00??voteWeb\.myme
?????文件???????1225??2010-05-26?22:59??voteWeb\.project
?????文件??????18330??2006-05-03?20:47??voteWeb\portable_mysql5\gpl.txt
?????文件???????1641??2007-10-01?09:27??voteWeb\portable_mysql5\jdbc\JDBCHelloWorld.class
?????文件???????1469??2007-10-01?09:58??voteWeb\portable_mysql5\jdbc\JDBCHelloWorld.java
?????文件?????440483??2007-08-04?10:18??voteWeb\portable_mysql5\jdbc\mysql-connector-java-3.1.11-bin.jar
?????文件????????330??2007-09-30?23:37??voteWeb\portable_mysql5\jdbc\mysql.sql
?????文件???????1339??2007-09-30?23:31??voteWeb\portable_mysql5\jdbc\常用?JDBC?驅動名字和?URL?列表.txt
?????文件?????????19??2007-10-01?09:25??voteWeb\portable_mysql5\jdbc\編譯.bat
?????文件?????????68??2007-10-01?09:26??voteWeb\portable_mysql5\jdbc\運行JDBC.bat
?????文件?????????53??2005-11-22?10:44??voteWeb\portable_mysql5\MySQL-Front\donate.url
?????文件?????????63??2005-11-22?10:44??voteWeb\portable_mysql5\MySQL-Front\faq.url
?????文件??????16133??2000-10-15?09:55??voteWeb\portable_mysql5\MySQL-Front\function.txt
?????文件?????233472??2002-08-14?04:13??voteWeb\portable_mysql5\MySQL-Front\libmySQL.dll
?????文件????????106??2002-01-10?21:02??voteWeb\portable_mysql5\MySQL-Front\my.ini
?????文件?????593408??2002-09-03?23:17??voteWeb\portable_mysql5\MySQL-Front\mysqlfront.exe
?????文件????????564??2001-10-02?16:49??voteWeb\portable_mysql5\MySQL-Front\mysqlfront.exe.manifest
?????文件?????????56??2005-11-22?10:44??voteWeb\portable_mysql5\MySQL-Front\mysqlfront.url
?????文件???????3925??2002-09-03?20:57??voteWeb\portable_mysql5\MySQL-Front\readme.txt
?????文件?????565760??2007-05-04?10:08??voteWeb\portable_mysql5\mysql50green\bin\libmySQL.dll
?????文件????1990656??2007-05-04?10:08??voteWeb\portable_mysql5\mysql50green\bin\mysqladmin.exe
?????文件????5701632??2007-05-04?10:00??voteWeb\portable_mysql5\mysql50green\bin\mysqld-nt.exe
?????文件??????????5??2007-10-07?14:27??voteWeb\portable_mysql5\mysql50green\data\beansoft-aty280.pid
?????文件??????????5??2007-10-06?12:38??voteWeb\portable_mysql5\mysql50green\data\beansoft.pid
?????文件?????????59??2010-05-06?16:59??voteWeb\portable_mysql5\mysql50green\data\db1\db.opt
?????文件???????8572??2010-05-06?17:00??voteWeb\portable_mysql5\mysql50green\data\db1\table1.frm
?????文件??????????9??2010-05-10?00:18??voteWeb\portable_mysql5\mysql50green\data\db1\table1.MYD
?????文件???????1024??2010-05-10?00:18??voteWeb\portable_mysql5\mysql50green\data\db1\table1.MYI
?????文件?????????65??2008-01-29?10:15??voteWeb\portable_mysql5\mysql50green\data\db_databa
............此處省略184個文件信息
評論
共有 條評論