资源简介
一、系统移植步骤
1、在MyEclipse中导入工程,可以通过Eclipse中的菜单File→Import→Existing Projects intoWorkspace中选择Project;
2、在MySQL中创建数据库,使用MySQL Control Center执行database目录下的dbscript.sql数据库脚本文件创建数据库SQL语句创建数据库和表及数据;
3、设置数据库连接配置,修改src目录下的database.properties文件,将其中的数据库用户名和密码设置为实际的用户名和密码;
4、在Eclipse中编译工程代码,部署到Tomcat,启动Tomcat,在浏览器输入http://localhost:8080/chpt5访问,管理台输入http://localhost:8080/chpt5/manage访问。
二、系统文件说明
database 数据库脚本文件,dbscript.sql为数据库脚本,含有数据库结构以及若干测试数据,如果不需要此测试数据,将dbscript.sql中的insert语句删除即可。
doc 系统移植说明文档
src Java源代码文件,src根目录下的database.properties为工程的数据库连接配置
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 < numBlocks; 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\系统移植说明.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
评论
共有 条评论