Package net.xoetrope.optional.data.sql

Examples of net.xoetrope.optional.data.sql.DatabaseTableModel


    myCombo.doLayout();
  }

  public void sort()
  {
    DatabaseTableModel completeVoltageTable = DatabaseTableModel.getTable( project, "Voltages" );
    completeVoltageTable.setDistinct( true );
    completeVoltageTable.setOrderField( "ID" );
    completeVoltageTable.retrieve();

    myTable.setModel( completeVoltageTable );
    updateBoundComponentValues();
  }
View Full Code Here


    updateBoundComponentValues();
  }

  public void filter()
  {
    DatabaseTableModel voltageTable = new DatabaseTableModel( project );
    // Set the query elements
    // FROM clause, FIELDS, WHERE clause
    voltageTable.setupTable( "CS_VOLTAGES", "VOLTAGE_DESCRIPTION, VOLTAGE_MIN, VOLTAGE_MAX", "FREQUENCY=50" );
    voltageTable.retrieve();
    myTable.setModel( voltageTable );
    updateBoundComponentValues();
  }
View Full Code Here

                               extraDbUrl,
                               rsEle.getAttribute( "user" ),
                               rsEle.getAttribute( "pwd" ) );
      }
      else {
        DatabaseTableModel tableModel = new DatabaseTableModel( currentProject );
        String escapeStr = rsEle.getAttribute( "escape" );
        if ( escapeStr != null )
          tableModel.setDoesEscapeProcessing( "true".equals( escapeStr ));
       
        tableModel.setName( rsEle.getAttribute( "id" ) );
        boolean updateDb = false;
        String updateStr = rsEle.getAttribute( "update" );
        if ( updateStr != null )
          updateDb = updateStr.compareTo( "true" ) == 0;

        String sqlStr = rsEle.getAttribute( "sql" );
        if (( sqlStr != null ) && ( sqlStr.length() > 0 ))
          tableModel.setSqlStatement( sqlStr, rsEle.getAttribute( "conn" ), updateDb );
        else {
            // We should probably change the name table to from as it equates to the FROM clause
          tableModel.setupTable( rsEle.getAttribute( "from" ),
                                 rsEle.getAttribute( "fields" ),
                                 rsEle.getAttribute( "where" ),
                                 rsEle.getAttribute( "conn" ),
                                 updateDb );
          String distinctStr = rsEle.getAttribute( "distinct" );
          if ( distinctStr != null )
            tableModel.setDistinct( distinctStr.equals( "true" ));

          tableModel.setOrderField( rsEle.getAttribute( "order" ) );
        }
        model.append( tableModel );
      }
      registerDatabaseNode( rsEle );
    }
View Full Code Here

TOP

Related Classes of net.xoetrope.optional.data.sql.DatabaseTableModel

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.