home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-24 | 1.5 KB | 41 lines |
- package borland.samples.tutorial.dataset.queryprovide;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.control.*;
- import borland.jbcl.layout.*;
- import borland.jbcl.dataset.*;
-
- public class QueryProvideFrame extends DecoratedFrame {
- BorderLayout borderLayout1 = new BorderLayout();
- BevelPanel bevelPanel1 = new BevelPanel();
- Database database1 = new Database();
- QueryDataSet queryDataSet1 = new QueryDataSet();
- GridControl gridControl1 = new GridControl();
- GridBagLayout gridBagLayout1 = new GridBagLayout();
-
- //Construct the frame
- public QueryProvideFrame() {
- try {
- jbInit();
- }
- catch (Exception e) {
- borland.jbcl.util.Diagnostic.printStackTrace(e);
- }
- }
-
- //Component initialization
- public void jbInit() throws Exception{
- this.setLayout(borderLayout1);
- this.setTitle("Querying your data source");
- bevelPanel1.setLayout(gridBagLayout1);
- database1.setConnection(new borland.jbcl.dataset.ConnectionDescriptor("jdbc:odbc:DataSet Tutorial", "sysdba", "masterkey", false, "sun.jdbc.odbc.JdbcOdbcDriver"));
- queryDataSet1.setQuery(new borland.jbcl.dataset.QueryDescriptor(database1, "select * from employee", null, true, false));
- gridControl1.setDataSet(queryDataSet1);
- this.add(bevelPanel1, BorderLayout.CENTER);
- bevelPanel1.add(gridControl1, new GridBagConstraints2(0, 0, 1, 1, 1.0, 1.0
- ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(24, 25, 24, 25), -1210, -634));
- }
- }
-
-