姿姿霸霸~~!
贵在坚持!
posts - 106,  comments - 50,  trackbacks - 0

 

改动之前:

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)

      (PROGRAM = extproc)

    )

  )

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

      (ADDRESS = (PROTOCOL = TCP)(HOST = sure1212)(PORT = 1521))

    )

  )


在netmanager中添加数据库的监听 


改动之后
:

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)

      (PROGRAM = extproc)

    )

    (SID_DESC =

      (GLOBAL_DBNAME = TEST.SURE)

      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)

      (SID_NAME = test)

    )

  )

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

    )

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = sure1212)(PORT = 1521))

    )

  )

posted @ 2010-05-16 17:09 xrzp 阅读(173) | 评论 (0)编辑 收藏
1.

SQL> drop user sysman cascade;

用户已删除。

SQL> drop role MGMT_USER;

角色已删除。

SQL> drop user MGMT_VIEW cascade;

用户已删除。

SQL> drop public synonym MGMT_TARGET_BLACKOUTS;

同义词已删除。

SQL> drop public synonym SETEMVIEWUSERCONTEXT;

同义词已删除。

2.emca -deconfig dbcontrol db -repos drop

3.emca -config dbcontrol db -repos create

posted @ 2010-01-27 23:36 xrzp 阅读(175) | 评论 (0)编辑 收藏
/**
     * 按照指定长度将字符串进行分割,中文字符算2个长度
     * 
@param str 字符串
     * 
@param length 指定长度
     * 
@return 如果字符串长度超出指定长度
     * ,则将字符串分成2个部分,分别装在map中
     
*/

    
public static Map getStr(String str, int length) {
        HashMap hashMap 
= new HashMap();
        String addr1 
= "";
        String addr2 
= "";

        
byte tmpBytes[] = str.getBytes();
        
int iByteLen = tmpBytes.length;
        
if (iByteLen > length) {
            
int iLen = 0;
            
for (int i = 0; i < length; i++{
                
if ((tmpBytes[i] & 0xFF> 0x80{
                    iLen 
+= 2;
                    i
++;
                    
continue;
                }
 else {
                    iLen 
+= 1;
                    
continue;
                }

            }


            addr1 
= new String(tmpBytes, 0, iLen);
            addr2 
= new String(tmpBytes, iLen, iByteLen - iLen);
        }
 else {
            addr1 
= str;
        }

        hashMap.put(
new Integer(1), addr1);
        hashMap.put(
new Integer(2), addr2);
        
return hashMap;
    }


0x80等于十进制的128,Turbo C中规定对ASCII码值大于0x80的字符将被认为是负数。
posted @ 2009-09-22 22:32 xrzp 阅读(2106) | 评论 (1)编辑 收藏
在web.xml,要对2个框架的分发,分别配置不同的url-pattern!!!
posted @ 2009-04-20 16:58 xrzp 阅读(542) | 评论 (0)编辑 收藏
public String getOriginalFilename(String filePath) {
        String filename 
= filePath;
        
if (filename == null{
            
return "";
        }

        
int pos = filename.lastIndexOf("/");
        
if (pos == -1{
            pos 
= filename.lastIndexOf("\\");
        }

        
if (pos != -1{
            
return filename.substring(pos + 1);
        }
 else {
            
return filename;
        }

    }
posted @ 2009-04-18 20:14 xrzp 阅读(230) | 评论 (0)编辑 收藏
new java.text.DecimalFormat("0.00").format(xxx);
posted @ 2009-04-08 12:41 xrzp 阅读(285) | 评论 (0)编辑 收藏

在web.xml中加入

<mime-mapping>   
    <extension>xls</extension>   
    <mime-type>application/excel</mime-type>  
</mime-mapping>

服务器端同时安装上Excel

posted @ 2009-03-26 10:29 xrzp 阅读(520) | 评论 (1)编辑 收藏
     摘要: 1.用spring的mail发邮件需要将j2ee包里的mail.jar和activation.jar引入 2.遇见的异常可能会有    (1)java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream    (2)java.lang.NoClassDefFoundErro...  阅读全文
posted @ 2008-10-18 16:18 xrzp 阅读(2700) | 评论 (4)编辑 收藏
    <!-- 配置事务开始 -->
    
<bean id="txManager"
        class
="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        
<property name="dataSource">
            
<ref bean="dataSource" />
        
</property>
    
</bean>
    
    
<tx:advice id="txAdvice" transaction-manager="txManager">
        
<tx:attributes>
            
<tx:method name="get*" read-only="true" />
            
<tx:method name="save*" propagation="REQUIRED"/>
            
<tx:method name="add*" propagation="REQUIRED"/>
            
<tx:method name="del*" propagation="REQUIRED"/>
            
<tx:method name="update*"/>
        
</tx:attributes>
    
</tx:advice>

    
<aop:config>
        
<aop:pointcut id="testTxAop"
            expression
="execution(* com.sure.demo.dao.*.*(..))" />
        
<aop:advisor advice-ref="txAdvice" pointcut-ref="testTxAop" />
    
</aop:config>
    
    
<!-- 配置事務結束 -->

使用事务的时候,在DAO就不要用try{}catch{}了,因为在catch里面捕获的异常,spring的事务貌似不能去回滚
posted @ 2008-10-15 22:47 xrzp 阅读(272) | 评论 (0)编辑 收藏
今天做了个aop的试验,对于springmvc的action不能拦截成功,研究了很久,没有找到问题,所以请教下大家.
下面是代码:

1.springmvc的action:
package com.sure.demo.web;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

public class DemoTestAction extends MultiActionController {

    
//返回的test页面
    private String testPage;
  
    
public String getTestPage() {
    
return testPage;
    }


    
public void setTestPage(String testPage) {
    
this.testPage = testPage;
    }




    
/**
     * test入口
     * 
@param request
     * 
@param response
     * 
@return
     * 
@throws Exception
     
*/

    
public ModelAndView test(HttpServletRequest request,
        HttpServletResponse response) 
throws Exception {
    ModelAndView mav 
= null;
    mav 
= new ModelAndView(this.getTestPage());
    request.setAttribute(
"test"new Date().toString());
    
return mav;
    }

    
}

2.jsp代码:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String test = (String)request.getAttribute("test");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  
<head>
 
  
</head>
  
  
<body>
    当前时间是:
<%=test %> <br>
  
</body>
</html>

3.aop代码:
package com.sure.aopdemo;

import org.aspectj.lang.JoinPoint;

public class AopDemoTestImpl {

    
public void afterTest(JoinPoint joinPoint) {
    System.out.println(
"aop--执行类:"+joinPoint.getThis()+""+joinPoint.getSignature().getName()+"方法之后");
    }


    
public void beforeTest(JoinPoint joinPoint) {
    System.out.println(
"aop--执行类:"+joinPoint.getThis()+""+joinPoint.getSignature().getName()+"方法之前");
    }


    
public void exceptionTest() {
    System.out.println(
"aop方法异常");
    }


}

4.xml关于aop的配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:aop
="http://www.springframework.org/schema/aop"
         xmlns:tx
="http://www.springframework.org/schema/tx"
         xsi:schemaLocation
="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
>
    
    
<bean id="aopDemoTestImpl" class="com.sure.aopdemo.AopDemoTestImpl"></bean>
    
    
<aop:config>
        
<aop:aspect id="test" ref="aopDemoTestImpl">
            
<aop:pointcut id="a" expression="execution(* com.sure.demo..*.*(..))"/>
            
<aop:before method="beforeTest" pointcut-ref="a"/>
            
<aop:after method="afterTest" pointcut-ref="a"/>
            
<aop:after-throwing method="exceptionTest" pointcut-ref="a"/>
        
</aop:aspect>
    
</aop:config>
    
</beans>
posted @ 2008-09-22 23:19 xrzp 阅读(7640) | 评论 (11)编辑 收藏
仅列出标题
共11页: First 上一页 3 4 5 6 7 8 9 10 11 下一页 

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(4)

随笔分类

随笔档案

好友的blog

搜索

  •  

积分与排名

  • 积分 - 115112
  • 排名 - 505

最新评论

阅读排行榜

评论排行榜