home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jsamples.z / QueryProvideFrame.java < prev    next >
Encoding:
Java Source  |  1997-07-24  |  1.5 KB  |  41 lines

  1. package borland.samples.tutorial.dataset.queryprovide;
  2.  
  3. import java.awt.*;
  4. import java.awt.event.*;
  5. import borland.jbcl.control.*;
  6. import borland.jbcl.layout.*;
  7. import borland.jbcl.dataset.*;
  8.  
  9. public class QueryProvideFrame extends DecoratedFrame {
  10.   BorderLayout borderLayout1 = new BorderLayout();
  11.   BevelPanel bevelPanel1 = new BevelPanel();
  12.   Database database1 = new Database();
  13.   QueryDataSet queryDataSet1 = new QueryDataSet();
  14.   GridControl gridControl1 = new GridControl();
  15.   GridBagLayout gridBagLayout1 = new GridBagLayout();
  16.  
  17.   //Construct the frame
  18.   public QueryProvideFrame() {
  19.     try {
  20.       jbInit();
  21.     }
  22.     catch (Exception e) {
  23.       borland.jbcl.util.Diagnostic.printStackTrace(e);
  24.     }
  25.   }
  26.  
  27.   //Component initialization
  28.   public void jbInit() throws Exception{
  29.     this.setLayout(borderLayout1);
  30.     this.setTitle("Querying your data source");
  31.     bevelPanel1.setLayout(gridBagLayout1);
  32.     database1.setConnection(new borland.jbcl.dataset.ConnectionDescriptor("jdbc:odbc:DataSet Tutorial", "sysdba", "masterkey", false, "sun.jdbc.odbc.JdbcOdbcDriver"));
  33.     queryDataSet1.setQuery(new borland.jbcl.dataset.QueryDescriptor(database1, "select * from employee", null, true, false));
  34.     gridControl1.setDataSet(queryDataSet1);
  35.     this.add(bevelPanel1, BorderLayout.CENTER);
  36.     bevelPanel1.add(gridControl1, new GridBagConstraints2(0, 0, 1, 1, 1.0, 1.0
  37.             ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(24, 25, 24, 25), -1210, -634));
  38.   }
  39. }
  40.  
  41.