1 24 25 package org.objectweb.cjdbc.scenario.raidb1.driver; 26 27 import java.sql.Connection ; 28 import java.sql.ResultSet ; 29 import java.util.ArrayList ; 30 31 import org.objectweb.cjdbc.scenario.templates.Raidb1Template; 32 import org.objectweb.cjdbc.scenario.tools.ScenarioUtility; 33 34 40 public class PrimaryKeysScenario extends Raidb1Template 41 { 42 public void testPrimaryKeys() throws Exception 43 { 44 Connection con = getCJDBCConnection(); 45 ResultSet keys = con.getMetaData().getPrimaryKeys(null, null, "PRODUCT"); 46 ArrayList list = ScenarioUtility.convertResultSet(keys); 47 assertTrue(list.size()==1); 48 ScenarioUtility.displayResultOnScreen(list); 49 50 ResultSet keys2 = con.getMetaData().getPrimaryKeys(null, null, "PPOSITION"); 51 ArrayList list2 = ScenarioUtility.convertResultSet(keys2); 52 ScenarioUtility.displayResultOnScreen(list2); 53 assertTrue(list2.size()==0); 54 } 55 } | Popular Tags |