-
大小: 2.39MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-11-16
- 語言: Java
- 標簽:
資源簡介
一、系統(tǒng)移植步驟
1、在MyEclipse中導入工程,可以通過Eclipse中的菜單File→Import→Existing Projects intoWorkspace中選擇Project;
2、在MySQL中創(chuàng)建數(shù)據(jù)庫,使用MySQL Control Center執(zhí)行database目錄下的dbscript.sql數(shù)據(jù)庫腳本文件創(chuàng)建數(shù)據(jù)庫SQL語句創(chuàng)建數(shù)據(jù)庫和表及數(shù)據(jù);
3、設(shè)置數(shù)據(jù)庫連接配置,修改src目錄下的database.properties文件,將其中的數(shù)據(jù)庫用戶名和密碼設(shè)置為實際的用戶名和密碼;
4、在Eclipse中編譯工程代碼,部署到Tomcat,啟動Tomcat,在瀏覽器輸入http://localhost:8080/chpt5訪問,管理臺輸入http://localhost:8080/chpt5/manage訪問。
二、系統(tǒng)文件說明
database 數(shù)據(jù)庫腳本文件,dbscript.sql為數(shù)據(jù)庫腳本,含有數(shù)據(jù)庫結(jié)構(gòu)以及若干測試數(shù)據(jù),如果不需要此測試數(shù)據(jù),將dbscript.sql中的insert語句刪除即可。
doc 系統(tǒng)移植說明文檔
src Java源代碼文件,src根目錄下的database.properties為工程的數(shù)據(jù)庫連接配置
WebRoot 工程web頁面文件

代碼片段和文件信息
package?com.jspsmart.upload;
import?java.io.ByteArrayInputStream;
import?java.io.FileOutputStream;
import?java.io.IOException;
import?java.math.BigInteger;
import?java.sql.ResultSet;
import?java.sql.SQLException;
import?javax.servlet.ServletException;
public?class?File
{
??private?SmartUpload?m_parent;
??private?int?m_startData;
??private?int?m_endData;
??private?int?m_size;
??private?String?m_fieldname;
??private?String?m_filename;
??private?String?m_fileExt;
??private?String?m_filePathName;
??private?String?m_contentType;
??private?String?m_contentDisp;
??private?String?m_typeMime;
??private?String?m_subTypeMime;
??private?String?m_contentString;
??private?boolean?m_isMissing;
??public?static?final?int?SAVEAS_AUTO?=?0;
??public?static?final?int?SAVEAS_VIRTUAL?=?1;
??public?static?final?int?SAVEAS_PHYSICAL?=?2;
??File()
??{
????m_startData?=?0;
????m_endData?=?0;
????m_size?=?0;
????m_fieldname?=?new?String();
????m_filename?=?new?String();
????m_fileExt?=?new?String();
????m_filePathName?=?new?String();
????m_contentType?=?new?String();
????m_contentDisp?=?new?String();
????m_typeMime?=?new?String();
????m_subTypeMime?=?new?String();
????m_contentString?=?new?String();
????m_isMissing?=?true;
??}
??public?void?fileToField(ResultSet?rs?String?columnName)
??????throws?SQLException?SmartUploadException?IOException?ServletException
??{
????long?numBlocks?=?0L;
????int?blockSize?=?0x10000;
????int?leftOver?=?0;
????int?pos?=?0;
????if?(rs?==?null)
??????throw?new?IllegalArgumentException(“The?RecordSet?cannot?be?null?(1145).“);
????if?(columnName?==?null)
??????throw?new?IllegalArgumentException(
??????????“The?columnName?cannot?be?null?(1150).“);
????if?(columnName.length()?==?0)
??????throw?new?IllegalArgumentException(
??????????“The?columnName?cannot?be?empty?(1155).“);
????numBlocks?=
????????BigInteger.valueOf(m_size).divide(BigInteger.valueOf(blockSize)).
????????longValue();
????leftOver?=
????????BigInteger.valueOf(m_size).mod(BigInteger.valueOf(blockSize)).intValue();
????try
????{
??????for?(int?i?=?1;?(long)?i?
??????{
????????rs.updateBinaryStream(
????????????columnName
????????????new?ByteArrayInputStream(m_parent.m_binArray?pos?blockSize)
????????????blockSize);
????????pos?=?pos?!=?0???pos?:?1;
????????pos?=?i?*?blockSize;
??????}
??????if?(leftOver?>?0)
????????rs.updateBinaryStream(
????????????columnName
????????????new?ByteArrayInputStream(m_parent.m_binArray?pos?leftOver)
????????????leftOver);
????}
????catch?(SQLException?e)
????{
??????byte?binByte2[]?=?new?byte[m_size];
??????System.arraycopy(m_parent.m_binArray?m_startData?binByte2?0?m_size);
??????rs.updateBytes(columnName?binByte2);
????}
????catch?(Exception?e)
????{
??????throw?new?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1262??2006-06-16?07:37??pressRelease\.classpath
?????文件????????289??2006-06-16?07:39??pressRelease\.myme
?????文件???????1345??2006-05-04?05:37??pressRelease\.project
?????文件???????1040??2006-06-16?07:39??pressRelease\.settings\com.genuitec.eclipse.j2eedt.core.prefs
?????文件???????8738??2006-06-16?07:31??pressRelease\databa
?????文件??????26112??2006-06-17?23:18??pressRelease\doc\系統(tǒng)移植說明.doc
?????文件???????7020??2005-12-10?19:48??pressRelease\src\com\jspsmart\upload\File.java
?????文件???????1374??2005-12-10?19:48??pressRelease\src\com\jspsmart\upload\Files.java
?????文件???????1749??2005-12-10?19:48??pressRelease\src\com\jspsmart\upload\Request.java
?????文件??????25537??2005-12-10?19:48??pressRelease\src\com\jspsmart\upload\SmartUpload.java
?????文件????????229??2005-12-10?19:48??pressRelease\src\com\jspsmart\upload\SmartUploadException.java
?????文件???????4248??2006-02-16?05:02??pressRelease\src\com\mycompany\databa
?????文件???????3280??2006-02-18?05:26??pressRelease\src\com\mycompany\filter\CharacterEncodingFilter.java
?????文件???????1103??2006-02-16?05:42??pressRelease\src\com\mycompany\news\dao\ChannelDAO.java
?????文件???????1047??2006-02-16?05:36??pressRelease\src\com\mycompany\news\dao\ColumnDAO.java
?????文件???????5544??2006-05-07?02:39??pressRelease\src\com\mycompany\news\dao\impl\ChannelDAOImpl.java
?????文件???????5880??2006-02-20?04:21??pressRelease\src\com\mycompany\news\dao\impl\ColumnDAOImpl.java
?????文件???????6990??2006-02-20?04:42??pressRelease\src\com\mycompany\news\dao\impl\NewsAttachmentDAOImpl.java
?????文件???????4616??2006-05-07?06:07??pressRelease\src\com\mycompany\news\dao\impl\NewsAttributeDAOImpl.java
?????文件???????3534??2006-05-07?21:44??pressRelease\src\com\mycompany\news\dao\impl\NewsCommentDAOImpl.java
?????文件???????9116??2006-05-07?22:05??pressRelease\src\com\mycompany\news\dao\impl\NewsDAOImpl.java
?????文件???????1379??2006-02-20?01:58??pressRelease\src\com\mycompany\news\dao\NewsAttachmentDAO.java
?????文件????????941??2006-05-07?06:29??pressRelease\src\com\mycompany\news\dao\NewsAttributeDAO.java
?????文件???????1381??2006-05-07?20:43??pressRelease\src\com\mycompany\news\dao\NewsCommentDAO.java
?????文件???????1419??2006-05-07?06:16??pressRelease\src\com\mycompany\news\dao\NewsDAO.java
?????文件???????1526??2005-11-13?22:43??pressRelease\src\com\mycompany\news\dto\Channel.java
?????文件???????2944??2006-02-16?04:29??pressRelease\src\com\mycompany\news\dto\Column.java
?????文件???????3276??2006-05-07?06:32??pressRelease\src\com\mycompany\news\dto\News.java
?????文件???????1577??2006-02-16?05:23??pressRelease\src\com\mycompany\news\dto\NewsAttachment.java
?????文件???????1338??2006-05-07?05:44??pressRelease\src\com\mycompany\news\dto\NewsAttribute.java
............此處省略274個文件信息
- 上一篇:仿駕考一點通源碼
- 下一篇:jdeclipse_update_site.zip
評論
共有 條評論