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 TestPublisherAssertionTable 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.begin(connection); 56 57 txn.commit(); 59 } 60 catch (Exception ex) 61 { 62 try 63 { 64 txn.rollback(); 65 } 66 catch (java.sql.SQLException sqlex) 67 { 68 sqlex.printStackTrace(); 69 } 70 throw ex; 71 } 72 } 73 } 74 } 75 | Popular Tags |