Skip to content

Instantly share code, notes, and snippets.

@bulain
bulain / MethodInvoking.xml
Created August 11, 2011 14:55
calling static and instance method in spring
<!-- call static method -->
<bean id="test" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="demo.Test" />
<property name="targetMethod" value="staticmethod" />
<property name="arguments">
<list>
<value>test</value>
</list>
</property>
</bean>
@bulain
bulain / separate_jvm.jsp
Created August 11, 2011 14:40
separate jvm in applet
<applet archive="applet.jar" code="demo.applet" width="0" height="0">
<param name="separate_jvm" value="true">
</applet>
@bulain
bulain / jms_spring.xml
Created July 19, 2011 07:15
JMS spring config
##applicationContext-jms.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:jboss.properties" />
<!-- <property name="location" value="classpath:activemq.properties" /> -->
</bean>
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
@bulain
bulain / ora_extends_conn.sql
Created July 19, 2011 01:13
extends connecions in oracle 10g
1, using system login
sqlplus system/password@xe
2, change system session configuration.
alter system set session_cached_cursors=200 scope=spfile;
alter system set session_max_open_files=200 scope=spfile;
alter system set sessions=20 scope=spfile;
alter system set license_max_sessions=200 scope=spfile;
alter system set license_sessions_warning=200 scope=spfile;
alter system set processes=200 scope=spfile;
@bulain
bulain / killpid.bat
Created July 19, 2011 01:08
kill process in windows
@echo off
@setlocal enabledelayedexpansion
for /F "tokens=* delims=;" %%i in ('netstat -nao') do call :keller %%i
:keller
set a=%2
echo %a%
if "%a%" equ "0.0.0.0:8081" (taskkill /F /PID %5)
shift