FileDocCategorySizeDatePackage
DBBean.javaAPI DocExample3632Sat Sep 12 03:01:00 BST 1998None

DBBean

public class DBBean extends BeanPanel implements borland.jbcl.util.BlackBox

Fields Summary
private BorderLayout
borderLayout1
private NavigatorControl
navigatorControl1
private GridControl
gridControl1
private Database
database1
private QueryDataSet
queryDataSet1
private StatusBar
statusBar1
private String
userName
private String
password
private String
query
private String
connectionURL
public static final String
EXAMPLE_EVENT
Constructors Summary
public DBBean()


    
    try {
      jbInit();
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  
Methods Summary
protected voidfireExampleActionEvent()

     
    //Args: event source,event ID, event command
    processActionEvent(new ActionEvent(this,ActionEvent.ACTION_PERFORMED, EXAMPLE_EVENT));
  
public java.lang.StringgetConnectionURL()

    connectionURL=database1.getConnection().getConnectionURL();
    return connectionURL;
  
public java.lang.StringgetPassword()

    password=database1.getConnection().getPassword();
    return password;
  
public java.lang.StringgetQuery()

    query=queryDataSet1.getOriginalQueryString();
    return query;
  
public QueryDataSetgetQueryDataSet()

    return queryDataSet1;
  
public java.lang.StringgetUserName()

    userName=database1.getConnection().getUserName();
    return userName;
  
private voidjbInit()

    navigatorControl1.setDataSet(queryDataSet1);
    gridControl1.setDataSet(queryDataSet1);
    database1.setConnection(new borland.sql.dataset.ConnectionDescriptor(
      connectionURL, userName, password, false, "sun.jdbc.odbc.JdbcOdbcDriver"));
    queryDataSet1.setQuery(new borland.sql.dataset.QueryDescriptor(
      database1, query, null, true, Load.ALL));
    statusBar1.setDataSet(queryDataSet1);
    this.setLayout(borderLayout1);
    this.add(navigatorControl1, BorderLayout.NORTH);
    this.add(gridControl1, BorderLayout.CENTER);
    this.add(statusBar1, BorderLayout.SOUTH);
  
public voidsetConnectionURL(java.lang.String s)

    connectionURL=s;
    database1.getConnection().setConnectionURL(s);
    
public voidsetPassword(java.lang.String s)

    password=s;
    database1.getConnection().setPassword(s);
  
public voidsetQuery(java.lang.String s)

    try {
      query=s;
      queryDataSet1.close();
      queryDataSet1.setQuery(new borland.sql.dataset.QueryDescriptor(database1, query));
      queryDataSet1.open();
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  
public voidsetQueryDataSet(QueryDataSet qds)

    navigatorControl1.setDataSet(qds);
    gridControl1.setDataSet(qds);
    statusBar1.setDataSet(qds);
    queryDataSet1 = qds;
  
public voidsetUserName(java.lang.String s)

    userName=s;
    database1.getConnection().setUserName(s);