1 24 25 package org.objectweb.cjdbc.scenario.raidb1; 26 27 import java.sql.Connection ; 28 import java.sql.ResultSet ; 29 import java.sql.Statement ; 30 31 import org.objectweb.cjdbc.scenario.templates.SimpleRaidb1Template; 32 import org.objectweb.cjdbc.scenario.tools.ScenarioUtility; 33 34 39 public class Raidb1TestLoadBalancersScenario extends SimpleRaidb1Template 40 { 41 46 public void testRoundRobyn() throws Exception 47 { 48 try 49 { 50 cm.loadVirtualDatabases(controller, "myDB", "hsqldb-raidb1-round-robin.xml"); 51 mainVdb = controller.getVirtualDatabase("myDB"); 52 mainVdb.enableAllBackends(); 53 54 Connection con = getCJDBCConnection(); 55 Statement statement = con.createStatement(); 56 ResultSet rs1 = statement.executeQuery("Select * from document"); 57 assertTrue("ResultSet is null", rs1.next()); 58 System.out.println(ScenarioUtility.convertResultSet(rs1)); 59 } 60 catch(Exception e) 61 { 62 e.printStackTrace(); 63 fail(e.getMessage()); 64 } 65 } 66 } | Popular Tags |