1 24 25 package org.objectweb.cjdbc.scenario.raidb1.loadbalancer; 26 27 import java.sql.Connection ; 28 import java.sql.ResultSet ; 29 import java.util.ArrayList ; 30 import java.util.HashMap ; 31 32 import org.objectweb.cjdbc.common.xml.DatabasesXmlTags; 33 import org.objectweb.cjdbc.scenario.templates.Raidb1Template; 34 import org.objectweb.cjdbc.scenario.tools.ScenarioUtility; 35 36 42 public class Raidb1AddingBackendScenario extends Raidb1Template 43 { 44 49 public void testAddNewBackend() throws Exception 50 { 51 hm.start("9003"); 53 hm.loaddatabase("9003"); 54 55 HashMap parameters = new HashMap (); 57 parameters.put(DatabasesXmlTags.ATT_url, 58 "jdbc:hsqldb:hsql://localhost:9003"); 59 60 mainVdb.replicateBackend("localhost", "localhost3", parameters); 62 63 mainVdb.forceEnableBackend("localhost3"); 64 65 hm.stop(hm1); 67 hm.stop(hm2); 68 69 Connection con = getCJDBCConnection(); 71 ResultSet rs = con.createStatement().executeQuery("select * from document"); 72 ArrayList list1 = ScenarioUtility.convertResultSet(rs); 73 System.out.println(list1); 74 } 75 } | Popular Tags |