### Question:
OracleDataSource extends BaseDataSource { @Override protected void appendDatabase(StringBuilder jdbcUrl) { if (getConnectType() == DbConnectType.ORACLE_SID) { jdbcUrl.append(":"); } else { jdbcUrl.append("/"); } jdbcUrl.append(getDatabase()); }  DbConnectType getConnectType(); void setConnectType(DbConnectType connectType); @Override String driverClassSelector(); @Override DbType dbTypeSelector();  }### Answer:
@Test public void testAppendDatabase() { OracleDataSource oracleDataSource = new OracleDataSource(); oracleDataSource.setAddress("jdbc:oracle:thin:@ oracleDataSource.setDatabase("test"); oracleDataSource.setConnectType(DbConnectType.ORACLE_SERVICE_NAME); StringBuilder jdbcUrl = new StringBuilder(oracleDataSource.getAddress()); oracleDataSource.appendDatabase(jdbcUrl); Assert.assertEquals("jdbc:oracle:thin:@ OracleDataSource oracleDataSource2 = new OracleDataSource(); oracleDataSource2.setAddress("jdbc:oracle:thin:@127.0.0.1:1521"); oracleDataSource2.setDatabase("orcl"); oracleDataSource2.setConnectType(DbConnectType.ORACLE_SID); StringBuilder jdbcUrl2 = new StringBuilder(oracleDataSource2.getAddress()); oracleDataSource2.appendDatabase(jdbcUrl2); Assert.assertEquals("jdbc:oracle:thin:@127.0.0.1:1521:orcl", jdbcUrl2.toString()); }