Package java.sql

Examples of java.sql.DriverPropertyInfo


    if ((url != null) && url.startsWith(URL_PREFIX)) {
      info = parseURL(url, info);
    }

    DriverPropertyInfo hostProp = new DriverPropertyInfo(HOST_PROPERTY_KEY,
        info.getProperty(HOST_PROPERTY_KEY, ""));
    hostProp.required = false;
    hostProp.description = "Hostname of Hive Server";

    DriverPropertyInfo portProp = new DriverPropertyInfo(PORT_PROPERTY_KEY,
        info.getProperty(PORT_PROPERTY_KEY, ""));
    portProp.required = false;
    portProp.description = "Port number of Hive Server";

    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];
View Full Code Here


        String[]             choices = new String[] {
            "true", "false"
        };
        DriverPropertyInfo[] pinfo   = new DriverPropertyInfo[6];
        DriverPropertyInfo   p;

        if (info == null) {
            info = new Properties();
        }
        p          = new DriverPropertyInfo("user", null);
        p.value    = info.getProperty("user");
        p.required = true;
        pinfo[0]   = p;
        p          = new DriverPropertyInfo("password", null);
        p.value    = info.getProperty("password");
        p.required = true;
        pinfo[1]   = p;
        p          = new DriverPropertyInfo("get_column_name", null);
        p.value    = info.getProperty("get_column_name", "true");
        p.required = false;
        p.choices  = choices;
        pinfo[2]   = p;
        p          = new DriverPropertyInfo("ifexists", null);
        p.value    = info.getProperty("ifexists", "false");
        p.required = false;
        p.choices  = choices;
        pinfo[3]   = p;
        p          = new DriverPropertyInfo("default_schema", null);
        p.value    = info.getProperty("default_schema", "false");
        p.required = false;
        p.choices  = choices;
        pinfo[4]   = p;
        p          = new DriverPropertyInfo("shutdown", null);
        p.value    = info.getProperty("shutdown", "false");
        p.required = false;
        p.choices  = choices;
        pinfo[5]   = p;
View Full Code Here

                                                                connStringSecretAttributes.length];
     
      int attrIndex = 0;
      for( int i = 0; i < connStringAttributes.length; i++, attrIndex++ )
      {
        optionsNoDB[attrIndex] = new DriverPropertyInfo(connStringAttributes[i][0],
                    finfo.getProperty(connStringAttributes[i][0]));
        optionsNoDB[attrIndex].description = MessageService.getTextMessage(connStringAttributes[i][1]);
      }

      optionsNoDB[0].choices = Monitor.getMonitor().getServiceList(Property.DATABASE_MODULE);
      // since database name is not stored in FormatableProperties, we
      // assign here explicitly
      optionsNoDB[0].value = dbname;

      for( int i = 0; i < connStringSecretAttributes.length; i++, attrIndex++ )
      {
        optionsNoDB[attrIndex] = new DriverPropertyInfo(connStringSecretAttributes[i][0],
                    (finfo.getProperty(connStringSecretAttributes[i][0]) == null? "" : "****"));
        optionsNoDB[attrIndex].description = MessageService.getTextMessage(connStringSecretAttributes[i][1]);
      }

      for( int i = 0; i < connBooleanAttributes.length; i++, attrIndex++ )
      {
        optionsNoDB[attrIndex] = new DriverPropertyInfo(connBooleanAttributes[i][0],
                   Boolean.valueOf(finfo == null? "" : finfo.getProperty(connBooleanAttributes[i][0])).toString());
        optionsNoDB[attrIndex].description = MessageService.getTextMessage(connBooleanAttributes[i][1]);
        optionsNoDB[attrIndex].choices = BOOLEAN_CHOICES;       
      }

View Full Code Here

    }

    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) {
        DriverPropertyInfo[] infos = new DriverPropertyInfo[2];

        infos[0] = new DriverPropertyInfo(HOST_PROPERTY_KEY, info.getProperty(HOST_PROPERTY_KEY));
        infos[0].required = true;
        infos[0].description = "The host to connect to";

        infos[1] = new DriverPropertyInfo(PORT_PROPERTY_KEY, info.getProperty(PORT_PROPERTY_KEY, "80"));
        infos[1].required = true;
        infos[1].description = "The port of the host to connect to";

        return infos;
    }
View Full Code Here

      case IColumnIndexes.IDX_REQUIRED:
      {
        // Use valueof when min supported JDK is 1.4
        //return Boolean.valueOf(_props[row].required);
        DriverPropertyInfo dpi = sdp.getDriverPropertyInfo();
        if (dpi != null)
        {
          return Boolean.valueOf(dpi.required);
        }
        return Boolean.FALSE;
      }

      case IColumnIndexes.IDX_DESCRIPTION:
      {
        DriverPropertyInfo dpi = sdp.getDriverPropertyInfo();
        if (dpi != null)
        {
          return dpi.description;
        }
        return s_stringMgr.getString("DriverPropertiesTableModel.unknown");
View Full Code Here

   * @param name the name of the driver property.
   * @param value the value of the driver property.
   * @param description a description of the driver property.
   */
  public void addRow(String name, String value, String description) {
    DriverPropertyInfo propInfo = new DriverPropertyInfo(name, value);
    propInfo.description = description;
    SQLDriverProperty newProp = new SQLDriverProperty(propInfo);
    _props.addDriverProperty(newProp);
    fireTableDataChanged();
  }
View Full Code Here

    {
      if (col != IDX_VALUE) { throw new IllegalStateException("Editor used for cell other than value"); }

      SQLDriverPropertyCollection coll = getTypedModel().getSQLDriverProperties();
      SQLDriverProperty sdp = coll.getDriverProperty(row);
      DriverPropertyInfo prop = sdp.getDriverPropertyInfo();
      if (prop.choices != null && prop.choices.length > 0)
      {
        _comboEditor.removeAllItems();
        for (int i = 0; i < prop.choices.length; ++i)
        {
View Full Code Here

    } // end method getMinorVersion()

    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
            throws SQLException {
        DriverPropertyInfo[] theInfos = {
                new DriverPropertyInfo(userProperty, "*"),
                new DriverPropertyInfo(passwordProperty, "*"), };
        return theInfos;
    }
View Full Code Here

    /*
     * Constructor test
     */
    public void testDriverPropertyInfoStringString() {

        DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo(
                validName, validValue);

        assertNotNull(aDriverPropertyInfo);

        aDriverPropertyInfo = new DriverPropertyInfo(null, null);

    } // end method testDriverPropertyInfoStringString
View Full Code Here

    static String updateName = "updateName";

    public void testPublicFields() {

        // Constructor here...
        DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo(
                validName, validValue);

        assertTrue(Arrays.equals(testChoices, aDriverPropertyInfo.choices));
        assertEquals(testValue, aDriverPropertyInfo.value);
        assertEquals(testRequired, aDriverPropertyInfo.required);
View Full Code Here

TOP

Related Classes of java.sql.DriverPropertyInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.