Lotus教程、Java教程、Java虚拟机、Java软件综合开发社区

Lotus、Domino、Java、C#、Web、数据库综合开发教程、资料社区

用批处理文件删除n天前的文件

Published by admin on 05月 7, 2012

服务器用来备份数据的硬盘过段时间就会被备份文件占满,弄得我老是要登录到服务器去手工删除那些老的文件,有时忘记了就会导致硬盘空间不足而无法备份。
因为只要保留最近几天的备份,如果可以做一个批处理让系统自动删除老备份文件就好了,但是Windows的命令行和Linux的Shell比起来功能差了很多,到底行不行我自己也不清楚。
于是上网查了一下各位大虾发的帖子,再经过自己的摸索和尝试,发现只要花点功夫还是能实现这个功能的。
下面来看看我的实现方法。

如果操作系统是 Windows Server 2003 那就好办了,因为它有一个forfiles命令能够查找满足指定条件的文件,下面是这个命令的用法。
forfiles /p <目标目录名> /d <天数> /c <执行的命令>

Read the rest of this entry »

为ckeditor编辑器添加行距功能

Published by admin on 05月 6, 2012

在选用ckeditor编辑器是,感觉缺少行距功能而遗憾,网上搜索资料零散,却很少有系统的例子,为此收集并整理,提供例子下载。为ckeditor编辑器添加行距功能,添加之后的效果如下:
Read the rest of this entry »

CKeditor加入中文字体

Published by admin on 05月 6, 2012

CKeditor确实非常好,但是编辑时,字体选择里面没有中文字体。可以按如下方法添加:

打开CKeditor目录里的config.js,在

CKEDITOR.editorConfig = function( config )
{
};
里添加如下代码:

Read the rest of this entry »

出现java.lang.IllegalArgumentException: id to load is required for loading的解决方法

Published by admin on 05月 1, 2012

使用了hibernate进行关系映射的时候,比如有一对多的关系,一个测试项目对应多个测试用例模块,部分的关系映射表:

代码

<many-to-one name=”testProject” class=”com.eyely.pojos.TestProject”>
<column name=”f_test_project_id” sql-type=”nvarchar2(32)” />
</many-to-one>
<set name=”testCaseModules” lazy=”true” inverse=”false”>
<key>
<column name=”f_test_project_id” sql-type=”nvarchar2(32)” />
</key>
<one-to-many class=”com.eyely.pojos.TestCaseModule”/>
</set>

相关Java文件:

Read the rest of this entry »

MSSQL如何查看当前数据库的连接数

Published by admin on 04月 2, 2012

1.通过系统的“性能”来查看:
开始->管理工具->性能(或者是运行里面输入 mmc)然后通过添加计数器添加 SQL 的常用统计然后在下面列出的项目里面选择用户连接就可以时时查询到数据库的连接数了。不过此方法的话需要有访问那台计算机的权限,就是要通过windows账户登陆进去才可以添加此计数器。

2.通过系统表来查询:
Read the rest of this entry »

JSTL标签对于Map集合的遍历,以及值得累加问题

Published by admin on 03月 4, 2012

JSTL标签对于Map集合的遍历:

Java代码

  1. <c:forEach items=“${shoppingCart}” var=“map”>
  2. <tr>
  3. <td>${map.key}</td>
  4. <td>${map.value.number }</td>
  5. <td>${map.value.price }</td>
  6. </tr>
  7. </c:forEach>

shoppingCart表示JSP页面所获取的HashMap对象,map表示在JSP页面中指向该集合对象。
map.key是取HashMap的键值;
map.value取的是HashMap中的value值,在此处表示的是一个JavaBean对象;
map.value.number/price表示的是取该JavaBean的字段所对应的值。

Read the rest of this entry »

如何查看ORACLE的版本?

Published by admin on 03月 2, 2012

COL PRODUCT FORMAT A35 COL VERSION FORMAT A15

COL STATUS FORMAT A15

SELECT * FROM PRODUCT_COMPONENT_VERSION;

Deployment failure on Tomcat 6.x. Could not copy all resources to

Published by admin on 02月 8, 2012

Deployment failure on Tomcat 6.x. Could not copy all resources to C:\tomcat6\webapps\OAPMS. If a file is locked, you can wait until the lock times out to redeploy, or stop the server and redeploy, or manually remove the deployment at C:\tomcat6\webapps\OAPMS

问题已解决,记得之前遇到过一次,但这次和前一次又不一样,解决办法:
1. 查看工程下的.mymetadata 看是否少了一个context-root=“” 属性,少的话,加上,值和前边的name属性一样,比如我的:
<?xml version=”1.0″ encoding=”UTF-8″?>
<project-module
type=”WEB”
name=”OAPMS”
id=”myeclipse.1191910938406″
context-root=”/OAPMS”
j2ee-spec=”1.4″
archive=”OAPMS.war”>
<attributes>
<attribute name=”webrootdir” value=”WebRoot” />
</attributes>
</project-module>

Read the rest of this entry »

webwork(java.lang.NoClassDefFoundError:com/uwyn/rife/continuations/ContinuationConfig )

Published by admin on 02月 4, 2012

java.lang.NoClassDefFoundError: com/uwyn/rife/continuations/ContinuationConfig
com.opensymphony.webwork.dispatcher.mapper.ActionMapperFactory.getMapper(ActionMapperFactory.java:31)
com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:88)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

缺少rife-continuations.jar

在Eclipse中遇到The type XXX cannot be resolved. It is indirectly referenced from required .class files错误

Published by admin on 02月 3, 2012

在Eclipse中遇到The type XXX cannot be resolved. It is indirectly referenced from required .class files错误…..,查找的解决办法如下:

一:
It is indirectly referenced from required .class file原因:你正要使用的类调用了另一个类,而这个类又调用了其他类,这种关系可能会有好多层。而在这个调用的过程中,某个类所在的包的缺失就会造成以上那个错误。

解决方法:导入缺失的包
Read the rest of this entry »

网站备案号:闽ICP备10026609号