jingliankui123的博客
jingliankui123 · 共 92 篇文章
java mail
public class Mail { private final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; private String host = null; //服务器 private int port = 25; //端口 private String auth = null; //权限 private String username = null; //用户邮箱 private String password = null; //密码 private boolean mailusername = false; /…
2010-02-23 14:20 · email · 评论(0) · HTML · Java · .net · Gmail · 多线程
mql数据库 连接
public final class HibernateUtil { private static SessionFactory sessionFactory = null; private static String path = Common.decode(Thread.currentThread().getContextClassLoader().getResource("../../config.properties").getPath()); private static String message = null; public static String getMessage(…
2010-02-23 14:18 · java · 评论(0) · JDBC · XML · MySQL · Hibernate · thread
linux 解压 tar.gz 文件命令
linux 解压 tar.gz 文件命令:tar zxvf tomcat6.0.tar.gz linux 修改文件名: mv tomcat5.0 tomcat6.0 查看某个进程:ps -ef | grep tomcat 复制文件 : cp 文件名 目标路径 唤起机器 : ether-wake 目标网卡地址 登录系统的所有记录 : last 登录失败的所有记录 :lastb 动态查看进程 : top 列出所有用户 : who -a 卸载 : yum remove 文件名 在线安装 : yum install 文件名 查找文件 : find / -name 文件名 下载 : sz 文件名
2010-02-23 14:14 · linux · 评论(0) · Tomcat · Linux
linux 下一些简单的网络配置命令
使用以下命令配置以太网络 1、 ifconfig 可以使用ifconfig命令来配置并查看网络接口的配置情况。 例如: (1) 配置eth0的IP地址, 同时激活该设备。 #ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up (2) 配置eth0别名设备eth0:1的IP地址,并添加路由。 #ifconfig eth0:1 192.168.1.3 #route add –host 192.168.1.3 dev eth0:1 (3) 激活设备。 #ifconfig eth0:1 up (4) 禁用设备。 #ifconfig eth0:dow…
2010-02-23 14:13 · linux · 评论(0) · 网络协议 · Socket · .net · UP · Linux
模仿spring获取dao
public final class BeanFactory { private static Map<String,Object> map = null; static { load(); } public static Object getBean(String beanName) { return map.get(beanName); } public static void load() { map = new HashMap<String,Object>(); try { Document doc = DocumentBuilderFactory.newInstance().new…
2010-02-23 14:12 · 评论(0) · DAO · Spring · XML · Bean · thread
lucene 索引小示例
//---------------------------创建索引 public class IndexWrite { private IndexWrite() {} public static String index () throws IOException { //要创建索引目录:F:/search/index_create File indexDirectory = new File (Common.INDEX_PATH + Common.INDEX_CREATE_DIRECTORY); //判断目录是否从在 if (indexDirectory.exists()) { retur…
2010-02-23 14:10 · java · 评论(4) · J# · Lucene · F# · Hibernate · JSP
cron crontab linux定时执行工具
cron 是linux下定时执行工具, 可以在无需人工干预的情况下运行作业。由于cron是linux的内置服务,不能自动起来,可以用一下方法启动,关闭服务: /sbin/service crond start //启动服务 /sbin/service crond stop //关闭服务 /sbin/service crond restart //重启服务 /sbin/service crond reload //重新载入配置 也可以将这个服务在系统启动的时候自动启动 在/etc/rc.d/rc.local 这个脚本的末尾加上:/sbin/service crond start cron 服务…
2010-02-23 14:06 · linux · 评论(0) · lighttpd · Bash · .net · 脚本 · Linux
js 正则的用法
if(!/(\S)+[@]{1}(\S)+[.]{1}(\w)+/.test(email)) alert("请输入正确的邮箱");
2010-02-23 14:02 · javacript · 评论(0)
Linux tomcat 安装
一、 jdk的安装 安装的jdk为:jdk-6u17-linux-x64-rpm.bin(linux下64位的) 1. 将文件上传至linux 2. 在当前目录输入 sh jdk-6u17-linux-x64-rpm.bin 3.看到 安装程序在询问您是否尊守许可协议页面 ,回车,空格都可以,看完协议. 出现一行字:Do you aggree to the above license terms? [yes or no] 安装程序在问您是否愿意遵守刚才看过的许可协议。输入"y" 或 "yes" 回车。 4.在命令行输入: vi /etc/profile 在里面添加如下内容 export JA…
2010-02-23 13:58 · linux · 评论(0) · Java · Apache · Tomcat · Linux · JDK
Hibernet分页
/** * 此文件描述的是:PageBean.java */ package cn.com.sohocat.util; import cn.com.sohocat.common.Common; /** * @author blaiu * */ public class PageBean { private String keyword; //关键字 private String urlAction; //超链action路径 private int pageNo; //pageNo:页号表示当前是第几页 private int totalRecords; //totalRecords:查询的…
2010-02-23 13:57 · hibernate · 评论(0) · JavaScript
java 常用工具类
package cn.com.sohocat.common; /** * 此文件描述的是:常用工具转换类 */ import java.io.File; import java.io.UnsupportedEncodingException; import java.text.DateFormat; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalen…
2010-02-23 13:54 · java · 评论(0) · Java · .net
spring BeanHelp的应用
BeanHelp.class package cn.com.sohocat.util; import java.io.File; import javax.servlet.ServletContext; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import org.springframework.web.context.support.WebApplicationConte…
2010-02-23 13:53 · spring · 评论(0) · fckeditor · Spring · XML · Web · Servlet
spring配置文件 和测类
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" http://www.springframework.org/schema/beans " xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " xmlns:aop=" http://www.springframework.org/schema/aop " xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframe…
2010-02-23 13:48 · java · 评论(0) · Spring · SQL · Hibernate · AOP · Bean
dwr
web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns=" http://java.sun.com/xml/ns/javaee " xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " version="2.5" xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "> <!-- dwr 配置 --> <serv…
2010-02-23 13:40 · java · 评论(0) · Spring · JavaEE · DWR · JavaScript · Servlet