`
weinan
  • 浏览: 38311 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
import sun.net.ftp.*; import sun.net.*; import java.io.*; import java.util.ArrayList; import java.util.List; /** * 使用sun.net.ftp工具包进行ftp上传下载 */ public class FtpTool { String ip; int port; String user; String pwd; String remotePath; String localPath; FtpClient ftpClient; ...
应用示例 1 从 Excel 文件读取数据表 Java Excel API 既可以从本地文件系统的一个文件 (.xls),也可以从输入流中读取 Excel 数据表。读取 Excel 数据表的第一步是创建 Workbook( 术语:工作薄 ),下面的代码片段举例说明了应该如何 ...
package com.test; public class Plus { public double plus(double d1, double d2) { return d1+d2; } import java.net.URL; import java.net.URLClassLoader; public class MyClassLoader extends URLClassLoader { public MyClassLoader() { super(new URL[0]); ...
需要下载一个Mail.jar包 MailSenderInfo.java package com.util.mail; /** *//**   * 发送邮件需要使用的基本信息 *author by wangfun http://www.5a520.cn 小说520  */ import java.util.Properties; public class MailSenderInfo { // 发送邮件的服务器的IP和端口 private String mailServerHost; private String mailServerPort = & ...
1.页面点击查询所有 int num = 1; int rowCount = 0; int size = 10;//定义分页的每页显示的初始个数 if(str_num != null && !"".equals(str_num)) { num = Integer.parseInt(str_num); } if(str_size != null && !"".equals(str_size)){ size = Integer.parseInt(str_size); ...
public String exportDispatchExcel() { String path=this.contextPvd.getRequest().getRealPath("/file/excel"); List<TblKepuoaRecordDispatch> list = (List<TblKepuoaRecordDispatch>) this.getOamessage().getAlluserList(); TblKepuoaRecordDispatch dispatch=new TblKepuoaRecord ...
package com.manze.stu; import java.io.*; public class IOTest { public static void samples() throws IOException { //1. 这是从文件中逐行读入数据 BufferedReader in = new BufferedReader(new FileReader("D:\\info.txt" )); Stri ...
透过 PC 登录工作站 执行格式:telnet hostname (在 dos 下执行) telnet ip-address Example: telnet doc telnet 140.122.77.120 注: 可利用指令 arp hostname 或 arp domain_name 查询 ip_address [编辑] 登录步骤 login : _______ > 输入 username password : _ ...
Socket:建立网络连接时使用. ServerSocket:用于服务器端. [一个简单的单线程的"Client-Server"例子] Server(服务器端):使用ServerSocket监听指定的端口,等待客户连接请求,客户连接后,会话产生. Client(客户端):使用Socket对服务器的端口发出连接请求,一旦连接成功,打开会话. ***********************Server******************** import java.io.Dat ...
模版页面Html <html> <head> <title>###title###</title> <meta http- equiv="Content-Type" content="text/html; charset=gb2312"> <LINK href="../css.css" rel=stylesheet type=text/css> </head> <body> <table widt ...
import java.io.UnsupportedEncodingException; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import net.source ...
import java.text.*; import java.util.*; /** * * <p> * Title: 通用工具类 * </p> * <p> * Description: 常用工具的集合,用来处理常见问题,比如中文乱码的方法等。 * </p> * <p> * Copyright: Copyright (c) 2003 * </p> * <p> * Company: Towery * </p> * * @author WangPinHeng ...
如果数据库查询的条数太多,在一个网页不方便显示时,考虑分页,只把部分送入前台,减少了数据传输量,提高了显示速度。 Mysql分页查询 - java^avaj - 走在架构师的路上 1、后台方法:在servlet,controller或action中得到分页后的文章,送往前台 import org.apache.log4j.Logger; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.jdbc.core.JdbcTe ...
package util; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.Properties; import java.util.ResourceBundle; public class ReadProperty{ public static String getProperty(String filename,String property){ ResourceBundle bundle = ResourceBundle.getBundle(filen ...
MyListener 类 import java.util.Timer; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class MyListener implements ServletContextListener { private Timer timer = null; public void contextInitialized(ServletContextEvent event) { timer ...
Global site tag (gtag.js) - Google Analytics