1 16 package org.apache.juddi.datastore.jdbc; 17 18 import java.sql.Connection ; 19 20 import org.apache.juddi.datatype.KeyedReference; 21 import org.apache.juddi.util.Config; 22 import org.apache.juddi.util.jdbc.Transaction; 23 24 27 class TestFindRelatedBusinessQuery 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 Transaction txn = new Transaction(); 51 52 KeyedReference keyedRef = new KeyedReference(); 53 keyedRef.setTModelKey(""); 54 keyedRef.setKeyName(""); 55 keyedRef.setKeyValue(""); 56 57 if (connection != null) 58 { 59 try 60 { 61 txn.begin(connection); 63 64 FindRelatedBusinessQuery.select("2a33d7d7-2b73-4de9-99cd-d4c51c186bce",connection); 65 FindRelatedBusinessQuery.selectWithKeyedRef("2a33d7d7-2b73-4de9-99cd-d4c51c186bce",keyedRef,connection); 66 67 txn.commit(); 69 } 70 catch(Exception ex) 71 { 72 try { txn.rollback(); } 73 catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); } 74 throw ex; 75 } 76 } 77 } 78 } | Popular Tags |