随笔-46  评论-54  文章-0  trackbacks-0
 
Windows XP SP2 + Oralce 9i

exp++.bat
1 set sid=portal
2 set username=portal
3 set password=portal
4 set connect=%username%/%password%@%sid%
5 set back_path=D:\oracle
6 set date_string=%date:~0,4%_%date:~5,2%_%date:~8,2%
7 set time_string=%time:~0,2%_%time:~3,2%_%time:~6,2%
8 set file_string=%back_path%\portal_%date_string%_%time_string%
9 exp %connect% buffer=20000000 file=%file_string%.dmp log=exp_%file_string%.log owner=portal

imp++.bat
 1 set dmp_source=%1
 2 set sid=his
 3 set username=his_dba
 4 set password=his_dba
 5 set connect=%username%/%password%@%sid%
 6 set back_path=D:\oracle
 7 set date_string=%date:~0,4%_%date:~5,2%_%date:~8,2%
 8 set time_string=%time:~0,2%_%time:~3,2%_%time:~6,2%
 9 set output_string=%back_path%\portal_%date_string%_%time_string%
10 set source_string=%back_path%\%dmp_source%
11 imp %connect% file=imp_%source_string% log=%output_string%.log FROMUSER=portal

Change CHARACTER SET
1 ALTER DATABASE CHARACTER SET UTF8
2 NLS_CHARACTERSET
3 ZHS16CGB231280
4 ZHS16GBK
5 AL32UTF8
6 UTF8


posted @ 2006-08-07 14:10 rox 阅读(1554) | 评论 (3)编辑 收藏
Commons 阅读笔记 之 Logging 篇

Configure commons-logging to use log4j
 1 Environment : Win2000Server,Tomcat-3.3a,AXIS and all the stuff for \
 2 Axis(commons-logging,xerces,log4j, etc.)
 3 
 4 What should I do for enabling output axis activity into log file?
 5 
 6 My log4j.properties file looks like:
 7 
 8 /************************************************************************/
 9 
10 log4j.rootCategory=INFO, LOGFILE
11 log4j.category.org.apache.axis=INFO
12 
13 
14 # LOGFILE is set to be a File appender using a PatternLayout.
15 log4j.appender.LOGFILE=org.apache.log4j.FileAppender
16 log4j.appender.LOGFILE.File=axis.log
17 log4j.appender.LOGFILE.Append=true
18 log4j.appender.LOGFILE.Threshold=INFO
19 log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
20 log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
21 
22 /************************************************************************/
23 
24 I'd created variable 
25 
26 TOMCAT_OPTS=log4j.configuration=file:/D:/jakarta-tomcat-3.3a/webapps/axis/WEB-INF/clas \
27 ses/log4j.properties           /* Here the place for file mentioned above */
28 
29 Then I had simply started from console window:
30 
31 java -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4jFactoryLog
32 
33 org.apache.axis.client.AdminClient list
34 
35 I had seen nothing neither on the console window neither in file axis.log
36 
37 What else should I do with commons-logging or log4j for logging?
38 
39 Any help would be very appreciated.
40 
41 Andrew

posted @ 2006-08-03 11:41 rox 阅读(306) | 评论 (0)编辑 收藏
一个可以快速实现网页内窗口的JS:
http://prototype-window.xilinus.com/

以前引用过,转到这里来,
很牛的网页效果,非常接近Windows视觉:
http://www.activewidgets.com/

一个国内牛人的系列产品:
http://www.linb.net/linb/index.html
posted @ 2006-07-11 09:29 rox 阅读(340) | 评论 (1)编辑 收藏
1、首先制作一个批处理,对集群IP进行DNS设置:
 1 @echo off 
 2 if not exist hosts goto WNT 
 3 echo 192.168.2.5 HIS_S0 >>C:\windows\hosts 
 4 echo 192.168.2.6 HIS_S1 >>C:\windows\hosts 
 5 goto END 
 6 :WNT 
 7 echo 192.168.2.5 HIS_S0 >>%systemroot%\system32\drivers\etc\hosts 
 8 echo 192.168.2.6 HIS_S1 >>%systemroot%\system32\drivers\etc\hosts 
 9 :END 
10 echo Finished!
11 pause > nul
12 cls

2、配置一个URL来连接这个集群,集群的服务名为HIS:
1 jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=HIS_S0)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=HIS_S1)(PORT=1521))(LOAD_BALANCE=yes))(CONNECT_DATA=(SERVICE_NAME=HIS)))

posted @ 2006-06-07 09:04 rox 阅读(498) | 评论 (1)编辑 收藏
Searching "iframe height 100" in 谷歌!
1、
<iframe height="100%"> 
no work

2、
<iframe stlye="height: 100%;"> 
no work

3、CSS
1 /*** html file ***/
2 
3 <class="forum2">
4  <iframe src="http://mydomain.com/phpbb" title="Forum" scrolling="auto">
5  </iframe>
6 </p>

 1 /*** css file ***/
 2 
 3 ..forum2 {
 4     height: 900px;
 5     width: 100%;
 6 }
 7 
 8 IFRAME {
 9     min-height: 900px;
10     height: 100%;
11     width: 100%;
12 }


4、JavaScript
 1 <script language="JavaScript">
 2 <!--
 3 function resize_iframe()
 4 {
 5   //resize the iframe according to the size of the
 6 
 7   //window (all these should be on the same line)
 8 
 9   document.getElementById("glu").height=
10     document.body.offsetHeight-
11     document.getElementById("glu").offsetTop-26;
12 }
13 
14 // this will resize the iframe every
15 // time you change the size of the window.
16 window.onresize=resize_iframe; 
17 
18 //Instead of using this you can use: 
19 //    <BODY onresize="resize_iframe()">
20 
21 
22 //-->
23 </script>

1 <iframe id='glu' width=100% onload='resize_iframe()'>
2 </iframe>


5、用CSS构建iframe效果的四种方法

6、W3C关于iframe的描述
posted @ 2006-04-18 19:28 rox 阅读(4913) | 评论 (5)编辑 收藏
desired在digg里写道,这里是一篇有趣的文章, 详细的讨论了为什么Ruby on Rails有那么多的优点却始终难以战胜Java或者ASP.net成为网络应用程序设计的主流语言。不过作者自己本身很喜欢Ruby on Rails,所以他虽然写了这篇文章,却丝毫不影响他对于Ruby on Rails最后定能成功地信心。
posted @ 2006-04-10 10:48 rox 阅读(323) | 评论 (0)编辑 收藏
转载


当然是Ruby相关的。
比如我常去:
http://groups.google.com/group/comp.lang.ruby?hl=zh-CN&lr=&newwindow=1
http://eigenclass.org/hiki.rb?WEBlog%3A%3ARuby
http://redhanded.hobix.com/
http://jimweirich.umlcoop.net/index.cgi

http://wiki.rubyonrails.org

http://www.railscn.com

http://chinaonrails.com/frontpage

http://ror.uuclubs.com

http://www.ruby-forum.com/


posted @ 2006-03-31 20:36 rox 阅读(332) | 评论 (0)编辑 收藏
http://www.ruby-lang.org/

这里有第一版的部分中文翻译
下载最新版本的Ruby,安装之后就有一个快捷指向ProgrammingRuby.chm,
很不错的书,已经有了2005年的2nd版本,可以到这里下载。(顺便做个广告
按照上面的例子,建立两个文件,

test.rb
 1 class Song
 2   def initialize(name, artist, duration)
 3     @name     = name
 4     @artist   = artist
 5     @duration = duration
 6   end
 7   def to_s  
 8     "Song: #{@name}--#{@artist} (#{@duration})"  
 9   end  
10 end
11 
12 class Song
13   attr_reader :name, :artist, :duration 
14 end
15 
16 class KaraokeSong < Song
17   attr_reader :lyrics
18   def initialize(name, artist, duration, lyrics)
19     super(name, artist, duration)
20     @lyrics = lyrics
21   end
22   def to_s  
23     "Karaoke" + super + "\nlyrics: #{@lyrics}"  
24   end
25 end

test2.rb
1 class Song
2   attr_writer :name, :artist, :duration 
3 end

然后在控制台下输入:
 1 C:\>ruby
 2 load "d:/ruby/mycode/test.rb"
 3 load "d:/ruby/mycode/test2.rb"
 4 song = Song.new("Bicylops", "Fleck", 260)
 5 puts song.inspect
 6 puts song.to_s
 7 song.name="Groovy"
 8 song.artist="Java"
 9 song.duration=15
10 puts song.inspect
11 puts song.to_s
12 ^D
13 #<Song:0x28366e0 @name="Bicylops", @duration=260, @artist="Fleck">
14 Song: Bicylops--Fleck (260)
15 #<Song:0x28366e0 @name="Groovy", @duration=15, @artist="Java">
16 Song: Groovy--Java (15)
注:这里的^D是Ctrl+D

这段代码,给我们什么启发呢?
posted @ 2006-03-25 23:51 rox 阅读(231) | 评论 (0)编辑 收藏
好像IE下可以,Firefox不行。
<input type="text" name="test" onclick="test.innerText='hello'">

posted @ 2006-02-17 17:39 rox 阅读(406) | 评论 (0)编辑 收藏
最近用 Hibernate 3 连接 Mysql 4 数据库。
调试时都还好,真正发布的时候毛病来了。
每天早晨都要都会报错,不能正常操作数据库。
Mysql 重启,无效,Tomcat 重启,有效。

Mysql(MySQL 4.1) 文档 7.5.2 节
Tuning Server Parameters 里面
在 Mysql控制台下输入 SHOW VARIABLES;
最后一个参数
wait_timeout    28800
如果单位是秒,也就是 8 个小时。
程序最后一次建立连接完毕之后 8 个小时,
Mysql 单方面关闭了这个连接。
但 Hibernate 还在记忆着这个连接基本信息。
程序再次连接的时候,已经不存在了。

不过,Hibernate 可以设置它自己的 timeout 。
到了 Hibernate 3 默认第三方的连接池管理,
由 Apache 的 DBCP 项目更换成了 c3p0 项目
它的属性在 Hibernate 配置属性有对应的写法,如:
c3p0.maxIdleTime = hibernate.c3p0.timeout
c3p0.maxPoolSize = hibernate.c3p0.max_size
所以,要修改一下 hibernate.cfg.xml 文档
将 Hibernate 默认连接池参数
<property name="connection.pool_size">5</property>
删除或注释掉,Hibernate 默认连接池比较初级。
然后,加入以下属性
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_size">5</property>
就可以使用 c3p0 来管理连接池了。
其实这些属性的参数名都可以在 Hibernate 文档 3.3 节
JDBC connections 里面找到。
按照相应的格式更改名字和值就可以了。

posted @ 2006-02-14 19:43 rox 阅读(12484) | 评论 (5)编辑 收藏
仅列出标题
共5页: 上一页 1 2 3 4 5 下一页