@Test(expected = FastLdrException.class) public void testGetDataSourceH2() throws FastLdrException, ParseException { System.setProperty(DataSourceFactory.DB_TYPE, "H2"); CmdArguments cmdArguments = new CmdArguments(); cmdArguments.setUserID(new UserID("uid/pwd@host/instance")); DataSourceFactory.getDataSource(cmdArguments); }
public static DataSource getDataSource(CmdArguments cmdArguments) throws FastLdrException { String sqlType = System.getProperty(DB_TYPE); if (sqlType == null || sqlType.equalsIgnoreCase("ORACLE")) { return new OracleDataSource(cmdArguments).getDataSource(); } else if (sqlType.equals("UNIVERSAL")) { return new UniversalDataSource().getDataSource(); } else { throw new FastLdrException("Unknown database type:" + sqlType); } }
DataSourceFactory { public static DataSource getDataSource(CmdArguments cmdArguments) throws FastLdrException { String sqlType = System.getProperty(DB_TYPE); if (sqlType == null || sqlType.equalsIgnoreCase("ORACLE")) { return new OracleDataSource(cmdArguments).getDataSource(); } else if (sqlType.equals("UNIVERSAL")) { return new UniversalDataSource().getDataSource(); } else { throw new FastLdrException("Unknown database type:" + sqlType); } } }
DataSourceFactory { public static DataSource getDataSource(CmdArguments cmdArguments) throws FastLdrException { String sqlType = System.getProperty(DB_TYPE); if (sqlType == null || sqlType.equalsIgnoreCase("ORACLE")) { return new OracleDataSource(cmdArguments).getDataSource(); } else if (sqlType.equals("UNIVERSAL")) { return new UniversalDataSource().getDataSource(); } else { throw new FastLdrException("Unknown database type:" + sqlType); } }  }
DataSourceFactory { public static DataSource getDataSource(CmdArguments cmdArguments) throws FastLdrException { String sqlType = System.getProperty(DB_TYPE); if (sqlType == null || sqlType.equalsIgnoreCase("ORACLE")) { return new OracleDataSource(cmdArguments).getDataSource(); } else if (sqlType.equals("UNIVERSAL")) { return new UniversalDataSource().getDataSource(); } else { throw new FastLdrException("Unknown database type:" + sqlType); } }  static DataSource getDataSource(CmdArguments cmdArguments); }
DataSourceFactory { public static DataSource getDataSource(CmdArguments cmdArguments) throws FastLdrException { String sqlType = System.getProperty(DB_TYPE); if (sqlType == null || sqlType.equalsIgnoreCase("ORACLE")) { return new OracleDataSource(cmdArguments).getDataSource(); } else if (sqlType.equals("UNIVERSAL")) { return new UniversalDataSource().getDataSource(); } else { throw new FastLdrException("Unknown database type:" + sqlType); } }  static DataSource getDataSource(CmdArguments cmdArguments); static final String DB_TYPE; }