1 16 package org.apache.juddi.datastore.jdbc; 17 18 import java.sql.Connection ; 19 20 import org.apache.juddi.util.Config; 21 import org.apache.juddi.util.jdbc.Transaction; 22 23 26 class TestTModelDocDescTable 27 { 28 public static void main(String [] args) 29 throws Exception 30 { 31 Config.setStringProperty("juddi.useConnectionPool","true"); 34 35 Connection conn = null; 36 try { 37 conn = Database.aquireConnection(); 38 test(conn); 39 } 40 finally { 41 if (conn != null) 42 conn.close(); 43 } 44 } 45 46 public static void test(Connection connection) throws Exception 47 { 48 Transaction txn = new Transaction(); 49 50 if (connection != null) 51 { 52 try 53 { 54 txn.commit(); 56 } 57 catch (Exception ex) 58 { 59 try 60 { 61 txn.rollback(); 62 } 63 catch (java.sql.SQLException sqlex) 64 { 65 sqlex.printStackTrace(); 66 } 67 throw ex; 68 } 69 } 70 } 71 } 72 | Popular Tags |