`
文章列表

庆祝点击量过100

在我一周来热情的写文章的努力下,今天博客点击量终于过100,庆贺一下。  
一、原理dom4j读xml的思想是,首先把要读的xml文件作为一个document(dom4j的类),这样外部的xml文件就转换成了dom4j可以操作的类型。然后找到document的根节点,在对根节点的字节点操作。在一个document中只有一个根节点,每个节点有0-n个子节点。此时的document节点就是一棵树,我们可以采用深度优先也可以采用广度优先来遍历整个树。我们对每一个节点我们可以获得它的名字和值。 public class DomUtil { public static Properties parseConfig(URL configName) { Document ...
Executes the given SQL statement, which may return multiple results. In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2 ...
round()和trunc()函数 1。应用到数学上 round()的含义是对操作数四舍五入运算。 第一个参数是操作数,第二个参数为精度要求 SELECT ROUND(1.298, 1) from dual;    1.3 SELECT ROUND(1.298, 0) from dual;    1 SELECT ROUND(23.298, -1) from dual;  20 trunc()的含义对操作数直接砍去一部分 第一个参数是操作数,第二个参数表示要保留小数位 SELECT TRUNC(1.223,1)  from dual; 1.2 SELECT TRUNC(1. ...
mysql中插入语句返回自增长操作 String insertPurviewRoleSql = "insert into purview_role(model_sg, operation_sg, role_id) values(?, ?, ?)";//定义sql语句 PreparedStatement pstatmInsertSystemPurview = conn.prepareStatement(insertSystemPurviewSql,PreparedStatement.RETURN_GENERATED_KEYS);//返回类型 pstatmInsertSyst ...
velocity小计 what:velocity是一个向客户的显示数据的一种很方便的语言,类似与jsp.velocity文件(在html中插入符合velocity语法的文件)是在服务器端运行的,通过velocity引擎(一个解释 template语法的java库)翻译,输出html文件,发送到客户端。通俗的说velocity是把客户请求的数据插入到合适的html文本中的一种工具。 how:velocity原理是把数据放入到一个map中,这个map通过引用被velocity引擎拿到,在引擎运行是,根据在html文本中插入的velocity语句,引擎通过$标示的变量,拿到需要的值, 填充到合适的位 ...
公司网站上有让用户匿名留言的功能,但是有三个必须的条件,公司或个人名称,联系人,联系电话。对这三个的要求既不想让输入空串就通过,还不想让随便输点东西就通过,特别是 电话要求不想太严格,又想让随便就蒙混过去。一下是测试程序。用户名和电话不能为空,电话号码至少含有7位以上的数字。 <html> <head> <title>测试</title> </head> <body> <form action="#"> 用户名:<input name="username&q ...
最近参加了几次面试,很多都会问道struts框架,所以自己准备了一些能够和面试官聊的东西,以及一些有可能给在面试官的留下深刻印象的话题。现在我成功找到了工作,所以 把这些东西整理了下,希望给在金融危机中找工作 ...
1. What is language for? Some people seem to think it's for practicing grammar rules and learning lists of words--- the longer the words the better. That's wrong. Language is for the exchange of ideas, for communication. (语言到底是用来干什么的呢?一些人认为它是用来操练语法规则和学习一大堆单词--而且单词越长越好。这个想法是错误的。语言是用来交换思想,进行交流沟通 的!) 2 ...
1、算出07年每个月发送邮件的总数 准备数据: user表 create table users( id int primary key auto_increment, name varchar(25) ); insert into users(name) values ('sunhaojie1'); insert into users(name) values ('sunhaojie2'); insert into users(name) values ('sunhaojie3'); create table events( id int primary key auto_incre ...
刚去轩辕互动面试,linux下三道题 1个半小时的,两个15分钟的 下面是两道需要半个小时的题 1.平衡点问题 平衡点:比如int[] numbers = {1,3,5,7,8,25,4,20}; 25前面的总和为24,25后面的总和也是24,25这个点就是平衡点;假如一个数组中的元素,其前面的部分等于后面的部分,那么这个点的位序就是平衡点 要求:返回任何一个平衡点 public class Equity{ public static int equity(int[] numbers){ int total=0; for(int i= ...
在论坛中寻找发帖网,主要是考察函数count和max的应用,共用了两张表users和posts, 建表语句并插入数据 CREATE TABLE `users` (   `id` int(11) NOT NULL auto_increment,   `name` varchar(20) default NULL,   PRIMARY KEY  (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; insert INTO users(name) values("tom"); insert INTO users(name) values(&qu ...
/* * 冒泡排序法 * 算法:第1趟排序找出对数组(array[0]--array[length-1])中最大的一个,把它放大array[length-1] * 第2趟排序找出对数组(array[0]--array[length-2])中最大的一个,把它放大array[length-2] * ...... * 第n趟排序找出对数组(array[0]--array[length-n])中最大的一个,把它放大array[length-n] */ @Test p ...
package junit.test; import java.util.Arrays; import org.junit.Test; public class excise { private int[] initArray = {8,2,56,23,14,3,29,88,23,36}; //递归的应用求年龄问题 /* * 用递归算法算出第1个人的年龄为10,第8个人的年龄是多 ...
Global site tag (gtag.js) - Google Analytics