锘??xml version="1.0" encoding="utf-8" standalone="yes"?>一区二区在线视频观看,欧美18免费视频,最新亚洲视频http://www.aygfsteel.com/silvernapoleon/archive/2006/09/25/70010.html#71657sunyisunyiMon, 25 Sep 2006 02:04:00 GMThttp://www.aygfsteel.com/silvernapoleon/archive/2006/09/25/70010.html#71657
u just do a such professional blog
can't understand
huhuhuhuhu


best wishes always


sunyi 2006-09-25 10:04 鍙戣〃璇勮
]]>
re: 鍝綅鍏勫紵浜嗚В"浜嬪姟" 甯府灝忓紵 涓嶈儨鎰熻阿http://www.aygfsteel.com/silvernapoleon/archive/2006/08/12/61376.html#63150##Sat, 12 Aug 2006 03:39:00 GMThttp://www.aygfsteel.com/silvernapoleon/archive/2006/08/12/61376.html#63150try{
/*
*1:璁劇疆鐜銆備負(fù)璁塊棶JNDI錛岀ⅶ琛鍒濆鍖栦笂涓嬫枃宸ュ巶銆佹彁渚沀RL銆佹墍闇鐨勭敤鎴峰悕銆佸瘑鐮?
*2錛氬叿浣撶粏鑺傦紝鍙互鍙傝冨簲鐢ㄦ湇鍔″櫒鐨勭粰鍑虹殑浜у搧鏂囨。
*3錛氭敞鎰忥紝閲嶇偣鍙傝冩枃妗d腑鏈夊叧JNDI鐨勯儴鍒?
*/
java.util.Properties env = ...
/*
*2:鑾峰緱JNDI鍒濆涓婁笅鏂?
*/
Context ctx = new InitialContext(env);
/*
*3:鍊熷姪浜嶫NDI錛屾煡鎵綣TA UserTransaction鎺ュ彛
*閫氬父錛屽鍣ㄩ兘鍥炴睙JTA鏆撮湶鍦ㄢ渏ava:comp/UserTransaction鈥濅綅緗?

*
*/
userTran = (javax.transaction.UserTransaction)
ctx.lookup("java:comp/UserTransaction");
/*
*4:鎵ц浜嬪姟
*/
userTran.begin();
//瀹屾垚涓氬姟鎿嶄綔
userTran.commit();
}
catch(Exception e)
//澶勭悊寮傚父錛屽寘鎷簨鍔″洖婊氱殑澶勭悊銆?

}

# 2006-08-12 11:39 鍙戣〃璇勮
]]>
re: 鍝綅鍏勫紵浜嗚В"浜嬪姟" 甯府灝忓紵 涓嶈儨鎰熻阿http://www.aygfsteel.com/silvernapoleon/archive/2006/08/07/61376.html#62224CrespoCrespoMon, 07 Aug 2006 11:14:00 GMThttp://www.aygfsteel.com/silvernapoleon/archive/2006/08/07/61376.html#62224import javax.transaction.*;
import java.sql.*;
import java.util.*;
import java.io.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class JTATest
{
public static void main(String args[])
{
Context ctx=null;
Hashtable ht=new Hashtable();
DataSource ds=null;
Statement stmt=null;
ResultSet rs=null;
Connection myConn = null;
UserTransaction tx = null;
String tablename="student";
String str1="INSERT INTO student VALUES ('01001001','ixucheng', 33)";
String str2="INSERT INTO student VALUES ('01001002','hangsan', 44)";
try
{
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
ctx=new InitialContext(ht);
String str="javax.transaction.UserTransaction";
tx =(UserTransaction)ctx.lookup(str);
tx.begin();
ds = (javax.sql.DataSource)ctx.lookup("TestData");
myConn= ds.getConnection();
stmt = myConn.createStatement();
stmt.executeUpdate (str1);
stmt.executeUpdate (str2);
tx.commit();
System.out.println("Success!");
}
catch (Exception E)
{
try{tx.rollback();}catch(Exception e){}
System.out.println("浜嬪姟鍙戠敓閿欒錛屼簨鍔¤鍙栨秷錛?");
}
finally
{
if (rs != null)
{
try{ rs.close(); } catch (Exception ignore) {};
}
if (stmt != null)
{
try{ stmt.close(); } catch (Exception ignore) {};
}
if (myConn != null)
{
try { myConn.close(); } catch (Exception ignore) {};
}

}
}
}

Crespo 2006-08-07 19:14 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 安多县| 延庆县| 隆昌县| 方山县| 尼木县| 中江县| 乌审旗| 佳木斯市| 台东县| 新巴尔虎右旗| 姚安县| 马关县| 基隆市| 会泽县| 内江市| 桃江县| 湖州市| 手游| 托里县| 科尔| 广水市| 军事| 玉溪市| 乾安县| 巴青县| 句容市| 柯坪县| 永春县| 大足县| 昌黎县| 奉贤区| 莒南县| 东兴市| 丘北县| 甘德县| 建水县| 阳山县| 梅州市| 诸城市| 宁阳县| 耿马|