@Test
 public void testGetPropertyInfo() throws SQLException {
   DriverPropertyInfo[] driverPropertyInfos =
       new DriverPropertyInfo[] {mock(DriverPropertyInfo.class)};
   when(delegate.getPropertyInfo(testUrl, properties)).thenReturn(driverPropertyInfos);
   assertArrayEquals(driverPropertyInfos, hiveDriver.getPropertyInfo(testUrl, properties));
 }
  /**
   * Gets information about the possible properties for the underlying driver.
   *
   * @param url the URL of the database to which to connect
   * @param info a proposed list of tag/value pairs that will be sent on connect open
   * @return an array of <code>DriverPropertyInfo</code> objects describing possible properties.
   *     This array may be an empty array if no properties are required.
   * @throws SQLException if a database access error occurs
   */
  public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
    Driver d = getUnderlyingDriver(url);
    if (d == null) {
      return new DriverPropertyInfo[0];
    }

    lastUnderlyingDriverRequested = d;
    return d.getPropertyInfo(url, info);
  }
 @Override
 public DriverPropertyInfo[] getPropertyInfo(final String url, final Properties info)
     throws SQLException {
   String translatedUrl = translate(url);
   for (Driver driver : getAllDrivers()) {
     if (driver.acceptsURL(translatedUrl)) {
       return driver.getPropertyInfo(translatedUrl, info);
     }
   }
   return null;
 }
 @Before
 public void setup() throws SQLException {
   testUrl = "testUrl";
   majorVersion = 10;
   minorVersion = 11;
   lazyDelegatingDriver = new LazyDelegatingDriver(driverRegistry, hasRegisterDriver);
   drivers = new ArrayList<>();
   drivers.add(makeEntry(badDriverServiceReference, badDriver));
   drivers.add(makeEntry(goodDriverServiceReference, driver));
   when(driver.connect(testUrl, null)).thenReturn(connection);
   when(driver.acceptsURL(testUrl)).thenReturn(true);
   when(driver.getPropertyInfo(testUrl, null))
       .thenReturn(new DriverPropertyInfo[] {driverPropertyInfo});
   when(driver.getMajorVersion()).thenReturn(majorVersion);
   when(driver.getMinorVersion()).thenReturn(minorVersion);
   when(driver.getParentLogger()).thenReturn(logger);
   when(driverRegistry.getDrivers()).thenReturn(drivers.iterator());
 }
Example #5
0
 /** ��ô������Ŀ���������Ϣ�� */
 public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
   return driver.getPropertyInfo(url, info);
 }
Example #6
0
 public DriverPropertyInfo[] getPropertyInfo(String u, Properties p) throws SQLException {
   return driver.getPropertyInfo(u, p);
 }
Example #7
0
 @Override
 public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
   return delegate.getPropertyInfo(url, info);
 }