2009年3月4日 星期三

Tomcat 5.5 JNDI設定

1. conf/context.xml:

<Resource name="jdbc/eflow"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    username="eflow"
    password="eflow123"
    url="jdbc:oracle:thin:@localhost:1521:orcl"
    maxActive="10"
    maxIdle="0"
    factory="org.apache.commons.dbcp.BasicDataSourceFactory" />

2. web.xml

<resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/eflow</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

2009年3月3日 星期二

How do I change the IP address on Oracle 10g

If the server's IP address changed, these are the first things I would look at:

The TNSNAMES.ORA file on the client -- does it have the IP address hardcoded? If so, change it. Does it use the machine name? If so, does the machine name resolve to the correct IP address on your client machine?

The LISTENER.ORA file on the server -- does it explicitly specify the old IP address as its listening address?

2009年2月4日 星期三

用java壓縮tar檔

package mytest;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.tools.tar.TarEntry;
import org.apache.tools.tar.TarOutputStream;

public class AntTarTest {

public static void main(String[] args) throws Exception {
String[] inputFiles = new String[] { "D:/txt/network.txt",
"D:/txt/sql.txt" };
new AntTarTest().tar("d:/AntTarTest.tar", inputFiles);
}

public void tar(String tarFileName, String[] inputFiles) throws IOException {
TarOutputStream out = new TarOutputStream(new FileOutputStream(
tarFileName));
int buffersize = 1024;
byte[] buf = new byte[buffersize];
for (int i = 0; i < inputFiles.length; i++) {
File file = new File(inputFiles[i]);
TarEntry te = new TarEntry(file.getName());
te.setSize(file.length());
out.putNextEntry(te);
FileInputStream in = new FileInputStream(file);
int count;
while ((count = in.read(buf, 0, buffersize)) != -1)
out.write(buf, 0, count);
out.closeEntry();
in.close();
}
out.close();
System.out.println("compress ok.");
}

}

2008年9月7日 星期日

Read environment variables in Java

_log.info("TEMP : " + System.getProperty("java.io.tmpdir"));
_log.info("PATH : " + System.getProperty("java.library.path"));
_log.info("CLASSPATH : " + System.getProperty("java.class.path"));
_log.info("SYSTEM DIR : " + System.getProperty("user.home"));
_log.info("CURRENT DIR: " + System.getProperty("user.dir"));

http://www.rgagnon.com/javadetails/java-0150.html

2008年8月20日 星期三

GP materials

1. GP - how to implement Service Level of Agreement in GP

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5929

2. Cross-application alerts in processes: An example based on Guided
Procedures

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9119

3. Guided Procedures Explorations: Process Runtime Dashboard

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6271

4. How To Create Dynamic Approval Process Using Conditional Loop Block
in Guided Procedure

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6664

5. A Tale of Two Brothers: Guided Procedures and the SAP NetWeaver BPM
Product

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10050

2008年8月10日 星期日

在WinXP開機、關機時自動執行指令碼

1.先從開始 » 執行... 輸入 gpedit.msc 然後按下 Enter,開啟群組原則。
2.然後找到本機電腦 原則 » 電腦設定 » Windows 設定 » 指令碼 - (啟動/關機)
3.在啟動及關機處,新增指令碼名稱及指令碼參數