Package java.sql

Examples of java.sql.DriverPropertyInfo


        List<DriverPropertyInfo> driverProps = new LinkedList<DriverPropertyInfo>();

        parseURL(url, info);

        for (String property: JDBCURL.KNOWN_PROPERTIES) {
          DriverPropertyInfo dpi = new DriverPropertyInfo(property, info.getProperty(property));
          if (property.equals(BaseDataSource.VDB_NAME)) {
            dpi.required = true;
          }
          driverProps.add(dpi);
        }
View Full Code Here


        assertTrue(p.getProperty(BaseDataSource.APP_NAME).equals("Client")); //$NON-NLS-1$
        assertEquals(7, p.size());       
    }   
   
    @Test public void testGetPropertyInfo1() throws Exception {       
        DriverPropertyInfo info[] = drv.getPropertyInfo("jdbc:teiid:vdb@mm://localhost:12345;applicationName=x", null); //$NON-NLS-1$

        assertEquals(19, info.length);
        assertEquals(false, info[0].required);
        assertEquals("ApplicationName", info[0].name); //$NON-NLS-1$
        assertEquals("x", info[0].value); //$NON-NLS-1$
View Full Code Here

  public synchronized void applyDriverPropertynfo(DriverPropertyInfo[] infoAr)
  {
    if (infoAr == null || infoAr.length == 0)
    {
      infoAr = new DriverPropertyInfo[1];
            infoAr[0] = new DriverPropertyInfo("remarksReporting", "true");
            infoAr[0].required = false;
            infoAr[0].description = "Set to true in order to table/column comments";
    }
    for (int i = 0; i < infoAr.length; ++i)
    {
View Full Code Here

    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
        throws SQLException
    {
        List<DriverPropertyInfo> list = new ArrayList<DriverPropertyInfo>();

        DriverPropertyInfo classInfo = new SortableDriverProperty(DRIVER_CLASS_PROP_KEY, null);
        classInfo.required = true;
        list.add(classInfo);
        DriverPropertyInfo urlInfo = new SortableDriverProperty(DRIVER_URL_PROP_KEY, null);
        urlInfo.required = true;
        list.add(urlInfo);
        DriverPropertyInfo userInfo = new SortableDriverProperty(DRIVER_USER_PROP_KEY, null);
        userInfo.required = true;
        list.add(userInfo);
        DriverPropertyInfo passInfo = new SortableDriverProperty(DRIVER_PASS_PROP_KEY, null);
        passInfo.required = true;
        list.add(passInfo);
        DriverPropertyInfo trackCalls = new SortableDriverProperty(TRACK_METHOD_CALLS_KEY, null);
        trackCalls.required = false;
        list.add(trackCalls);
        List<SortableDriverProperty> connMethods =
            getMethods("java.sql.Connection", "ProxyConnection");
        Collections.sort(connMethods);
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

                                                                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)
      throws SQLException {
     DriverPropertyInfo infoProp = new DriverPropertyInfo("url",url);
      DriverPropertyInfo[] dpi = new DriverPropertyInfo[1];
      dpi[0]=infoProp;
    return dpi;
  }
View Full Code Here

    static DriverPropertyInfo[] getDriverPropertyInfo() {
        Pragma[] pragma = Pragma.values();
        DriverPropertyInfo[] result = new DriverPropertyInfo[pragma.length];
        int index = 0;
        for (Pragma p : Pragma.values()) {
            DriverPropertyInfo di = new DriverPropertyInfo(p.pragmaName, null);
            di.choices = p.choices;
            di.description = p.description;
            di.required = false;
            result[index++] = di;
        }
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

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.