ITeye博客

2011 年文章归档

共 28 篇文章

java 多级目录创建文件

方式一: File file = new File("c:\\aa\\bb\\cc\\tt.txt"); file.getParentFile().mkdirs(); file.createNewFile(); File fileParentFile = file.getParentFile(); 返回的是File类型的 fileParentFile.mkdirs(); 方法二: File file = new File(resultFile); File fileParentFile = file.getParentFile(); fileParentFile.mkdirs(); Stri…

2011-12-21 10:43 · java总结

oracle update 满足某一个条件进行更改

update tablename t set t.record_day ='20111124' where t.record_day='20111123'

2011-11-25 11:10 · Oracle

将双引号(“”) 存入数据库的处理方法

将双引号(“”) 存入数据库的处理方法: 例如 :“恐男症”女孩挺进男子中学Ⅱ 存入数据库,按照下图所示的方式进行处理。 “ ----> “ 女性,你必须知道 …… …… ----> …… 诗香雅韵 —— 古典诗词名句选读 —— ----> ——

2011-11-15 09:26 · web前端 · Oracle

Ajax-dwr Session Error

在运行的ajax程序的时候却出现了下面的问题. Firefox 前台页面跳出 Session Error 的对话框,IE没有任何提示。 控制台提示信息: 2011-10-30 19:10:53 org.apache.catalina.core.ApplicationContext log 信息: dwr: A request has been denied as a potential CSRF attack. web.xml配置文件 <servlet> <servlet-name>dwr</servlet-name> <servlet-class>org.directwebremoting…

2011-10-30 19:09 · ajax-dwr

jqgrid 如何提示有数据 无数据

关于jqgrid生成表单无数据时的显示。它本身的样式是会在右下角显示无数据显示, 能不能让他把‘无数据信息的提示‘显示在表格中间? 在无数据的时候在表单中显示无数据显示,右下角的小字太不明显了 其实感觉右下角也不错。要在中间显示的话,如下 样式,拿loading样式用的,自己可以改 .norecords { border-width: 2px !important; display:none; font-weight: bold; left: 45%; margin: 5px; padding: 6px; position: absolute; text-align: center; top…

2011-10-26 16:27 · jqgrid

java 中数组是值类型还是引用类型。

java 中数组是值类型还是引用类型。 Object o = new int {1,2,3}; 观点1;数组类型是一族类型,它们都继承自System.Array,而System.Array又继承自System.Object。所有的数组类型都是引用类型。 观点2:看你的数组是用的类对象还是基本数据类型了 如果是值类型的数组,比如int,那里面存的就是值类型。 引用类型,就存引用咯! 观点3:除了基本数据类型,其他的都是引用数据类型 或者其他说法!

2011-10-13 23:16

疑难杂症

Your host does not support the current guest settings in fullscreen mode. Try reducing your guest's resolution or color depth and try again. Failed to switch to full screen SVGA mode. tomcat Unable to create logger at..... D:\Tomcat7.0\bin>tomcat7 系统找不到指定的路径。 Unable to create logger at 'D:\Tomcat 7…

2011-10-11 22:46 · 操作系统

java获取文件名的三种方法

import java.io.File; import java.util.Arrays; public class FileName { /** * @param args */ public static void main(String[] args) { // 举例: String fName =" G:\\Java_Source\\navigation_tigra_menu\\demo1\\img\\lev1_arrow.gif "; // 方法一: File tempFile =new File( fName.trim()); String fileName = tempFile…

2011-10-09 15:47 · java总结

三种for循环样式

三种for循环样式 1、for(int i = 0;i < 100;i++) //递减和递加的算一种 2、for(;true;) //有空表达式的 3、for (int i = 100, j = 100; i > 0 || j>0 ; i--,j++) //有多表达式的 好像就这么多了。但是还有一种,我无法理解的表达式 for(;;)这是个 死循环 无限循环(没有跳出语句,才能成为死循环) 遍历Collection对象的传统方式 /* 建立一个Collection / String strings = {"A", "B", "C", "D"}; Collection stringList =…

2011-09-27 20:42 · java总结

随机生成颜色

import java.util.Random; /** * 颜色工具 * */ public class ColorUtil { /** * 生成随机颜色代码 * * @return */ public static synchronized String getRandomColorCode() { // 颜色代码位数 int colorLength = 6; // 颜色代码数组 char[] codeSequence = { 'A', 'B', 'C', 'D', 'E', 'F', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };…

2011-08-25 09:24 · java总结

火狐浏览器回复弹框

此操作被浏览器拒绝! 请在浏览器地址栏输入“about:config”并回车 然后将设置为'true'

2011-08-23 21:11 · 生活

在 Windows XP 中修复损坏的 Winsock2,网上其他方法都是浮云。

在 Windows Server 2003、Windows VISTA、Windows XP 中修复损坏的 Winsock2。 我的操作系统是xp 的 ,其他的系统不知道又没有用。 按照如下操作,解决了我的问题。在网上找了很多方法都没有用!现在分享给大家。 问题: 出现: Microsoft Firewall Client will not use Winsock2 结果: 1 Winsock2 损坏无法连接网络(说白了就是不能上网), 2 打开360 安全卫士会出现 通信错误。 出现的问题原因: 目前我还不清楚。 解决方案: winsock XP Fix_VB-WinFix 1.2_TCP…

2011-07-17 14:36 · 操作系统

eclipse怎么取消拼写提示

看图

2011-07-15 22:04 · MyEclipse使用小结

在Eclipse下运行是不能使用Console类

在Eclipse下运行是不能使用Console类。 Console console = System.console();//获得Console实例 if(console!=null){//判断console是否可用 String line = System.console().readLine(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); String line = bufferedReader.readLine(); Console类别也提供有reader(…

2011-07-07 23:43 · java总结

Oracle修改数据库表字段

select t.*, t.rowid from portal_cvmspt_extra_bill t 1 将修改的字段置空 update portal_cvmspt_extra_bill t set t.tip_message = [color=red]null[/color] 2 设置将需要修改的字段 alter table portal_cvmspt_extra_bill modify [color=green]tip_message [/color][color=red]NUMBER(2)[/color]

2011-05-11 18:55 · Oracle

3种Java从文件路径中获取文件名的方法

package test; import java.io.File; public class FileName { /** * @param args */ public static void main(String[] args) { // 举例: String fName =" G:\\Java_Source\\navigation_tigra_menu\\demo1\\img\\lev1_arrow.gif "; // 方法一: File tempFile =new File( fName.trim()); String fileName = tempFile.getName();…

2011-05-11 09:53 · java总结

数组转集合Collections:Arrays.asList(values)

将一个数组转换为list集合时,使用List <数组类型>list = Arrays.asList(数组),当转换后,list不可改变大小。 import java.util.Arrays; import java.util.Collections; import java.util.List; public static void main(String args){ String str = {"aaa","bbb","ccc"}; List dayList = new ArrayList (Arrays.asList(str)); dayList.add("aaa"); System.…

2011-05-05 17:23 · java总结

String public byte[] getBytes()的使用

String d1 = " cool "; byte buf [ ] = d1.getBytes ( ) ; for ( int i=0; i < buf.length; i++ ) { System.out.println ( " Index " + i + "is : " + buf [ i ] ) ; } public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) //Use getChars ( ) to copy from one string to another string: src = "…

2011-04-13 09:27

迭代Map

for ( Iterator iterator = aMap.entrySet ( ) .iterator ( ) ; iterator.hasNext ( ) ; ) { Map.Entry entry = ( Map.Entry ) iterator.next ( ) ; String key = ( String ) entry.getKey ( ) ; String value = ( String ) entry.getValue ( ) ; } for ( Iterator it=pairList.entrySet ( ) .iterator ( ) ; it.hasNext (…

2011-04-13 09:13 · java总结

一个好的json jar包

String json = new JSONSerializer().serialize(list);

2011-03-22 09:08 · JSON