
java相关
文章平均质量分 51
火箭丸子
艾比斯星球战神
展开
-
java 中文和unicode字符串互相转换(文件需要保存为gbk2312或者asci格式)
public class ConvertString{ public static void main(String args[]){ String aa = "\u8fd9\u662f\u4e00\u4e2a\u4e2d\u6587\u5b57\u7b26\u4e32"; String bb = ""; String cc = "这是一个中文字符串"; String dd =原创 2013-09-26 15:45:50 · 4335 阅读 · 0 评论 -
java unicode编码转汉字
import java.io.*;public class unicodeTest{ private static String loadConvert (char[] in, int off, int len, char[] convtBuf) { if (convtBuf.length < len) { int newLen = len * 2原创 2013-09-26 15:34:59 · 5204 阅读 · 0 评论 -
简单存储过程:从表B中查询出数据插入A中
--从表B中每周一到周五查询出数据放到表A中。--创建testa,testb并在B中填充数据create table testa(id number(10),name varchar2(10),age varchar2(10), ext1 varchar2(10));create table testb(id number(10),name varchar2(10),age varchar2原创 2013-11-01 09:54:17 · 5810 阅读 · 0 评论 -
java时间转换
String inputStr = "Dec 12, 2013 1:54:03 AM PST"; SimpleDateFormat sdf = new SimpleDateFormat("MMM d, yyyy K:m:s a",Locale.ENGLISH); SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:s原创 2013-12-13 10:15:17 · 626 阅读 · 0 评论 -
java判断是否为金额
//金额验证 public static boolean isNumber(String str) { java.util.regex.Pattern pattern=java.util.regex.Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"); // 判断小数点后2位的数字的正则表原创 2014-08-16 19:48:06 · 18823 阅读 · 1 评论 -
myeclipse不能使用默认编辑器打开导入的struts项目的struts-config.xml,Therefore the MyEclipse Struts Editor may not be u
将eclipse中的struts1项目的导入到myeclipse2014后发现struts-config.xml不能用默认的编辑器打开,报错如下:Project Struts1Test is not configured as a MyEclipse Web-Struts Project. Therefore the MyEclipse Struts Editor may not be used with struts-config.xml. The default XML Editor has been原创 2016-02-19 23:40:38 · 1974 阅读 · 0 评论 -
java listener实现定时任务
使用java ServletContextListener 实现各种简单定时任务。1. 创建ServletContextListener,在3.0版本的web.xml中不再需要添加listener的声明。package com.test.listener;import java.text.ParseException;import java.text.SimpleDateFormat原创 2016-08-01 21:30:42 · 2999 阅读 · 0 评论