1 16 package org.apache.juddi.datastore.jdbc; 17 18 import java.sql.Connection ; 19 import java.util.Vector ; 20 21 import org.apache.juddi.util.Config; 22 import org.apache.juddi.util.jdbc.Transaction; 23 24 27 class TestFindTModelByNameQuery 28 { 29 public static void main(String [] args) 30 throws Exception 31 { 32 Config.setStringProperty("juddi.useConnectionPool","true"); 35 36 Connection conn = null; 37 try { 38 conn = Database.aquireConnection(); 39 test(conn); 40 } 41 finally { 42 if (conn != null) 43 conn.close(); 44 } 45 } 46 47 public static void test(Connection connection) 48 throws Exception 49 { 50 String name = new String (""); 51 52 Vector keysIn = new Vector (); 53 keysIn.add("uuid:327A56F0-3299-4461-BC23-5CD513E95C55"); 54 keysIn.add("uuid:4064C064-6D14-4F35-8953-9652106476A9"); 55 keysIn.add("uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88"); 56 keysIn.add("uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03"); 57 keysIn.add("uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823"); 58 keysIn.add("uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4"); 59 keysIn.add("uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039"); 60 keysIn.add("uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2"); 61 keysIn.add("uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4"); 62 keysIn.add("uuid:CD153257-086A-4237-B336-6BDCBDCC6634"); 63 keysIn.add("uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384"); 64 keysIn.add("uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E"); 65 66 Transaction txn = new Transaction(); 67 68 if (connection != null) 69 { 70 try 71 { 72 txn.begin(connection); 74 75 FindTModelByNameQuery.select(name,keysIn,null,connection); 76 FindTModelByNameQuery.select(name,null,null,connection); 77 78 txn.commit(); 80 } 81 catch(Exception ex) 82 { 83 try { txn.rollback(); } 84 catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); } 85 throw ex; 86 } 87 } 88 } 89 } 90 | Popular Tags |