正则表达式使用五例(转贴)
-、分组提取以apache log为例,如下:192.168.1.138 - - [03/Feb/2006:01:40:20 +0800] "GET /phpinfo.php HTTP/1.1" 404 295//分别为 客户端IP、访问日期、请求路径、服务端响应Code、请求文件大小[@more@]-、分组提取以apache log为例,如下:192.168.1.138 - - [03/Feb/2006:01:40:20 +0800] "GET /phpinfo.php HTTP/1.1" 404 295//分别为 客户端IP、访问日期、请求路径、服务端响应Code、请求文件大小其正则表达式为:String pattern="^([d.]+)(S+)(S+)[([w:/]+s[+|-]d{4})]s"(.+)"s(d{3})s(d+)
树的层次体现的sql方案
树的层次体现的sql方案[@more@]SQL> select * from test; ID PARENT_ID---------- ---------- 1 0 2 1 3 2 11 0 22 11 33 22 4 2 44 228 rows selected要得到如下的结果: ID PARENT_ID 层次---------- ---------- ---- 1 0 0 2 1 1 3 2 2 4 2 2 11 0 0 22
代码运行调试框
代码运行调试框html代码如下:[@more@]<html> <title>代码运行调试框</title> <style> body{overflow:hidden;margin:0px} textarea{width:100%;height:95%} body,textarea,button{font:normal 12px Tahoma;color:#333333} </style> <script> function runCode(){ with(open()){ opener=null document.write(code.value) document.close() } } function Command(cmd){ code.select() document.execCommand(cmd)
有感而发
对任何事情都要说出自己的见解,这很重要。不要太计较对与错。[@more@]
J2EE Study Note
J2EE Architecture----------------------Tier 1: ClientTier 2: J2EE Server a. EJB Container:Enterprise Bean b. Web Container:JSP File,ServletTier 3: Database Server[@more@]----------------------J2EE Server----------------------The J2EE Server provies the following services:. Naming and Directory - allows programs to locate services and components through the Java Naming and Directory Interface (JNDI)API. Authentication - enforces security by requiring users to log in. HTTP - enable
JBoss EJB CMP2性能测试(转载)
前言作者使用了EJB CMP2.0抽象持久性模式,结合会话Bean,验证JBoss EJB CMP2.0 O/R Mapping的数据处理能力。CMP/CMR能够从容应付各种表结构和关系的映射,CMP2.0对于数据查询也有一套EJB QL的机制。但就测试结果来看,JBoss CMP2.0还不足以应付大量的数据。测试环境操作系统:Win2000CPU:PIII733EBMemory:512MApplication Server:JBoss-3.0.2DBMS:SAP DB7.3Java VM:JDK-1.4.1Ant:1.5.1[@more@]测试方案 *表结构表:AUX_TYPE COLUMN名 SAP DB类型 Java类型AUX_ID (Primary Key) Integer IntegerAUX_DESC V
JBOSS维护经验(转载)
一、设置控制台登录窗口安装好jboss并启动jboss后,在浏览器窗口的地址栏里键入http://localhost:8080/jm-console[@more@]http://localhost:8080/jmx-console就可以浏览jboss的部署管理的一些信息,默认情况下不键入任何用户名和密码就可以进入此页面, 方便是方便,但真正使用起来还是有点安全隐患,因为不管任何人只要知道server的ip 都可以进去访问。下面我们针对此问题对jboss进行配置,使得访问jmx-console也必须 要知道用户名和密码才可进去访问.步骤:1. 进入jmx-console.war,通常此目录在{jboss_home}serverdefa
位与操作,bitand的使用
bitand(x,y)通过位与操作可以推出以下操作:位或操作=(x + y) - bitand(x,y)位异或操作=(x + y) - bitand(x,y) * 2[@more@]
测试StringTokenizer的用法
import java.util.* ;public class StringTokenizerTest { public static void main(String[] args) { String s = "305015,305016,305017" ; String re ; StringTokenizer t = new StringTokenizer(s ,",") ; System.out.println(t.hasMoreTokens()) ; System.out.println(t.countTokens()) ; while (t.hasMoreTokens()) { re = t.nextToken() ; System.out.println(re) ; System.out.println(t.hasMoreTokens()) ; System.out.println(t.countTokens()) ; } }}[@more@]
数组排序的测试
直接插入排序、折半插入排序、2-路插入排序代码如下...[@more@]public class testSort { public static void main(String[] args) { String[] x = {"bb" ,"aa" ,"pp" ,"xx" ,"yy"} ; StringPrint(x ,"Before Sort:") ; InsertSort(x) ; StringPrint(x ,"After Sort:") ; String[] y = {"bb" ,"aa" ,"pp" ,"xx" ,"yy"} ; StringPrint(y ,"Before Sort:") ; BInsertSort(y) ; StringPrint(y ,
编译EJB出现错误的解决
在对EJB包进行编译的时候出现如下错误:Archiver 'com.borland.jbuilder.enterprise.module.ejb.EjbModuleArchiver' not available解决方法:在用文本工具打开工程文件(*.jpx),找到<property category="archiving" name="archiverClass" value="com.borland.jbuilder.enterprise.module.ejb.EjbModuleArchiver"/>这一行,改为<property category="archiving" name="archiverClass" value="com.borland.jbuilder.enterprise.module.ModuleArchiver"/>就ok了[@
常用的sql列表
稍加整理的比较常用的sql列表[@more@]--监控索引是否使用alter index &index_name monitoring usage;alter index &index_name nomonitoring usage;select * from v$object_usage where index_name = &index_name;--求数据文件的I/O分布select df.name,phyrds,phywrts,phyblkrd,phyblkwrt,singleblkrds,readtim,writetim from v$filestat fs,v$dbfile df where fs.file#=df.file# order by df.name;--求某个隐藏参数的值col ksppinm format a54col ksppstvl format a54select ksppinm, ksppstvl from x$ksppi pi, x$ksppcv cv
一个删除重做日志文件的参考脚本
适用于windows操作系统,如果是unix系统需修改。[@more@]set feedback off set linesize 300set pagesize 3000set serveroutput onspool d:deletefile.cmddeclarefilepath varchar2(100) ;beginfilepath := '&1' ;for rec in (select thread#,sequence# from v$log_history where trunc(first_time) = trunc(sysdate - 1)and sequence# > 991)loopdbms_output.put_line('del ' || filepath || '' || rec.thread# || '_' || rec.sequence# || '.dbf') ; end loop ;end ;/spool offset feedback onset linesize 80set pagesize 14$d:
得到对表操作的脚本(可作为参考)
得到对表操作的脚本(可作为参考)[@more@]--使约束失效的脚本set feedback offset pagesize 0spool d:disableconstraint.sqlselect 'alter table ' || table_name || chr(10) || ' disable constraint ' ||constraint_name || ';' objfrom user_constraintswhere constraint_type in ('R');spool off--启用约束的脚本spool d:enableconstraint.sqlselect 'alter table ' || table_name || chr(10) || ' enable constraint ' ||constraint_name || ';' objfrom user_constraintswhere constraint_type in ('R');spool off--清空表的脚本sp
重建outln用户脚本(不知道以前在什么地方看到的,现贴出共享)
-- createoutln.sql的详细脚本[@more@]set serveroutput on declare user_exists exception;outln_user number;outln_tables number;extra_outln_tables number;ddl_cursor integer;beginselect count(*) into outln_user from user$ where name = 'OUTLN';select count(*)into outln_tablesfrom obj$where name in ('OL$', 'OL$HINTS') andowner# = (select user# from user$ where name = 'OUTLN');select count(*)into extra_outln_tablesfrom obj$where name not in ('OL$', 'OL$HINTS') and type# = 2 andowner# = (select user# fro
一个测试数组用法的例子
一个测试数组用法的例子[@more@]create or replace package pk_test istype array_test is varray(3) of integer;end pk_test;/create or replace procedure test_array(aa in pk_test.array_test)isbeginfor i in 1..3loopdbms_output.put_line(aa(i)); end loop; end;/set serveroutput ondeclarea pk_test.array_test;begina := pk_test.array_test();a.extend(3);a(1) := 1;a(2) := 2;a(3) := 3; test_array(a);end;/ SQL> 123PL/SQL procedure successfully completed
sqlplus-help
sqlplus-help[@more@]SQL> helpHELP----Accesses this command line help system. Enter HELP INDEX for a listof topics.In iSQL*Plus, click the Help button to display iSQL*Plus help.HELP [topic]SQL> help indexEnter Help [topic] for help.@ COPY PAUSE SHUTDOWN@@ DEFINE PRINT SPOOL/ DEL PROMPT SQLPLUSACCEPT DESCRIBE QUIT STARTAPPEND DISCONNECT RECOVER STARTUPARCHIVE LOG EDIT REMARK STOREATTRIBUTE EXECUTE REPFOOTER TIMINGBREAK EXIT REPHEADER TTITLEBTITLE GET RESERVED WORDS (SQL) UNDEFINECHANGE HELP
新学一个函数nvl2(a,b,c)
一直用8i,最近接触9i。好多新东西都不是很了解。nvl2(a,b,c)当a为空时返回c,否则返回b。SQL> select nvl2(1,'a','aa') from dual;NVL2(1,'A','AA')----------------aSQL> select nvl2(null,'a','aa') from dual;NVL2(NULL,'A','AA')-------------------aa好,现在可以不用把decode和nvl结合起来用了。呵呵[@more@]
Oracle Faq
http://www.itpub.net/180363.html[@more@]
sqlplus help install
http://www.cnoug.org/viewthread.php?tid=1710[@more@]