Search in sources :

Example 1 with DriverPropertyInfo

use of java.sql.DriverPropertyInfo in project hive by apache.

the class HiveDriver method getPropertyInfo.

@Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
    if (info == null) {
        info = new Properties();
    }
    if ((url != null) && url.startsWith(Utils.URL_PREFIX)) {
        info = parseURLforPropertyInfo(url, info);
    }
    DriverPropertyInfo hostProp = new DriverPropertyInfo(HOST_PROPERTY_KEY, info.getProperty(HOST_PROPERTY_KEY, ""));
    hostProp.required = false;
    hostProp.description = "Hostname of Hive Server2";
    DriverPropertyInfo portProp = new DriverPropertyInfo(PORT_PROPERTY_KEY, info.getProperty(PORT_PROPERTY_KEY, ""));
    portProp.required = false;
    portProp.description = "Port number of Hive Server2";
    DriverPropertyInfo dbProp = new DriverPropertyInfo(DBNAME_PROPERTY_KEY, info.getProperty(DBNAME_PROPERTY_KEY, "default"));
    dbProp.required = false;
    dbProp.description = "Database name";
    DriverPropertyInfo[] dpi = new DriverPropertyInfo[3];
    dpi[0] = hostProp;
    dpi[1] = portProp;
    dpi[2] = dbProp;
    return dpi;
}
Also used : Properties(java.util.Properties) DriverPropertyInfo(java.sql.DriverPropertyInfo)

Example 2 with DriverPropertyInfo

use of java.sql.DriverPropertyInfo in project Mycat-Server by MyCATApache.

the class DriverPropertyInfoHelper method addPropInfo.

private void addPropInfo(final ArrayList<DriverPropertyInfo> propInfos, final String propName, final String defaultVal, final String description, final String[] choices) {
    DriverPropertyInfo newProp = new DriverPropertyInfo(propName, defaultVal);
    newProp.description = description;
    if (choices != null) {
        newProp.choices = choices;
    }
    propInfos.add(newProp);
}
Also used : DriverPropertyInfo(java.sql.DriverPropertyInfo)

Example 3 with DriverPropertyInfo

use of java.sql.DriverPropertyInfo in project Mycat-Server by MyCATApache.

the class DriverPropertyInfoHelper method addPropInfo.

private void addPropInfo(final ArrayList<DriverPropertyInfo> propInfos, final String propName, final String defaultVal, final String description, final String[] choices) {
    DriverPropertyInfo newProp = new DriverPropertyInfo(propName, defaultVal);
    newProp.description = description;
    if (choices != null) {
        newProp.choices = choices;
    }
    propInfos.add(newProp);
}
Also used : DriverPropertyInfo(java.sql.DriverPropertyInfo)

Example 4 with DriverPropertyInfo

use of java.sql.DriverPropertyInfo in project robovm by robovm.

the class OldDriverPropertyInfoTest method testPublicFields.

public void testPublicFields() throws Exception {
    Class.forName(classname).newInstance();
    Properties props = new Properties();
    Driver d = DriverManager.getDriver(connectionURL);
    DriverPropertyInfo[] info = d.getPropertyInfo(connectionURL, props);
    // get the property metadata
    String name = info[0].name;
    assertNotNull(name);
    assertEquals(name, "encoding");
    String[] choices = info[0].choices;
    assertNull(choices);
    boolean required = info[0].required;
    assertFalse(required);
    String description = info[0].description;
    assertNull(description);
}
Also used : Driver(java.sql.Driver) Properties(java.util.Properties) DriverPropertyInfo(java.sql.DriverPropertyInfo)

Example 5 with DriverPropertyInfo

use of java.sql.DriverPropertyInfo in project robovm by robovm.

the class OldDriverPropertyInfoTest method testDriverPropertyInfoStringString.

public void testDriverPropertyInfoStringString() {
    DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo(validName, validValue);
    assertNotNull(aDriverPropertyInfo);
    assertEquals(aDriverPropertyInfo.name, validName);
    assertEquals(aDriverPropertyInfo.value, validValue);
    aDriverPropertyInfo = new DriverPropertyInfo(null, null);
    assertNotNull(aDriverPropertyInfo);
    assertNull(aDriverPropertyInfo.name);
    assertNull(aDriverPropertyInfo.value);
}
Also used : DriverPropertyInfo(java.sql.DriverPropertyInfo)

Aggregations

DriverPropertyInfo (java.sql.DriverPropertyInfo)12 Properties (java.util.Properties)5 ArrayList (java.util.ArrayList)2 Driver (java.sql.Driver)1 JdbcDriverPropertyInfo (org.apache.ignite.internal.jdbc.JdbcDriverPropertyInfo)1 HsqlDatabaseProperties (org.hsqldb_voltpatches.persist.HsqlDatabaseProperties)1 HsqlProperties (org.hsqldb_voltpatches.persist.HsqlProperties)1 PropertyDescriptor (org.jkiss.dbeaver.model.impl.PropertyDescriptor)1 DBPPropertyDescriptor (org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor)1