`
hanqunfeng
  • 浏览: 1526839 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
添加用户: [root@localhost ~]# useradd test[root@localhost ~]# passwd testChanging password for user test.New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully.此时,该用户才是可以使用的。 设置的默认规则如下:[root@localhost ~]# useradd -DGROUP=100HOME=/homeINACTIVE=-1EXPIRE=SHEL ...
在javascript中操作textarea时如果要换行,需要加上换行符\n,但当要删除一行时却无法找到"\n”的匹配,原因就是换行符应该是"\r\n",加上这个就可以匹配了。 例如: function tempFunc(object){var temp = document.getElementById("temp").value;var clip = document.getElementById("clip_ip");if(temp!=""){if(object){if(clip.value.in ...
//提取查找字符串前面所有的字符function getFront(mainStr,searchStr){foundOffset=mainStr.indexOf(searchStr);if(foundOffset==-1){return null;}return mainStr.substring(0,foundOffset);}//提取查找字符串后面的所有字符function getEnd(mainStr,searchStr){foundOffset=mainStr.indexOf(searchStr);if(foundOffset==-1){return null;}return mainS ...
package com.netqin.data.weather; import java.util.Iterator;import java.util.LinkedHashMap;import java.util.Map;import java.util.Set; public class CharacterToPinyin { /*** @param args*/public static void main(String[] args) {// TODO Auto-generated method stubSystem.out.println(getFullSpell("北京 ...

java验证日期格式

    博客分类:
  • JAVA
public static boolean checkDate(String date) {String eL = "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([024 ...
原文之地:http://blog.csdn.net/Nicolas_Yang/archive/2008/12/12/3504480.aspx 【JAVA 中执行Shell】 jShell.java /* * jShell.java * class jShell is used for executing shell command * USAGE: * jShell obj=new jShell(shellCommand); * obj.startErr(); * obj.startOut(); * obj.startIn(); * You can Interupt I/O threa ...
原文地址:http://www.ibm.com/developerworks/cn/java/j-lo-spring25-mvc/index.html 使用 Spring 2.5 基于注解驱动的 Spring MVC   基于注解的配置有越来越流行的趋势,Spring 2.5 顺应这种趋势,为 Spring MVC 提供了完全基于注解的配置。本文将介绍 Spring 2.5 新增的 Sping MVC 注解功能,讲述如何使用注解配置替换传统的基于 XML 的 Spring MVC 配置。 继 Spring 2.0 对 Spring MVC 进行重大升级后,Sp ...
1. 使用Spring注解来注入属性 1.1. 使用注解以前我们是怎样注入属性的 类的实现: Java代码 publicclassUserManagerImplimplementsUserManager{ privateUserDaouserDao; publicvoidsetUserDao(UserDaouserDao){ this.userDao=userDao; } ... } public class UserManagerImpl implements UserManager { private UserDao userDao; publi ...
1.java.util.Date to java.sql.Date java.sql.Date sqlDate = new java.sql.Date(new java.util.Date().getTime()); 2.java.sql.Date to java.util.Date java.sql.Date sqlDate = ……; java.util.Date utilDate = new java.util.Date(sqlDate.getTime()); 3.java.util.Date to java.sql.Timestamp java.sql.T ...
1.String to InputStream String str = "String与InputStream相互转换"; InputStream in_nocode = new ByteArrayInputStream(str.getBytes()); InputStream in_withcode = new ByteArrayInputStream(str.getBytes("UTF-8")); 2.InputStream to String 这里提供几个方法。 方法1: publicStringconvertStreamToS ...
如果希望从ServerA免输入passwd ssh到ServerB,先在ServerA上执行: ssh-keygen -b 1024 -t rsa  //生产密钥对   例如:连续回车即可   hanqf@localhost:~$ ssh-keygen -b 1024 -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/hanqf/.ssh/id_rsa): Created directory '/home/hanqf/.ssh'.Enter pass ...
最近在开发一项目时使用了spring注解式事务管理,现介绍如下: 一.spring配置文件 这里使用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:context="http://www.spr ...
spring对jdbc操控LOB也提供了简单的方式,以oracle数据库为例,方式如下: 一.spring配置文件 <!-- 提供对lob字段的支持 --><bean id="nativeJdbcExtractor"class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"lazy-init="true" /> <bean id="oracleLobHandler" class ...
spring为hibernate提供了对LOB对像的支持,以oracle数据库为例,配置方法如下: 一.spring配置文件 <!-- 使用jndi连接数据库 --><!--<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"><property name="jndiName"><value>java:comp/env/develop</value></prope ...
有时因为测试需要,要在数据库中模拟大量的数据,而这些数据都有一定的规律,比如现在有一个包含200个用户昵称的数据文件,要将这些昵称导入到用户表中,用户表的属性有姓名、昵称、性别、年龄、用户类型等等,姓名必须是字母和数字组成的,而年龄只能取值0、1、2,分别代表女、男、保密,而年龄需要在18~35岁之间,用户类型只能取两个值(普通,高级),如何模拟出这样一些数据呢,使用shuf命令可以轻松搞定。方法如下: 一.准备数据文件 1.性别数据文件:sex.list 0 1 2 2.年龄数据文件:age.list 18 19 20 …… …… 35 3.用户类型数据文件:type ...
Global site tag (gtag.js) - Google Analytics