import java.lang.*; import java.awt.*; import java.io.*; //import java.net.*; //import java.awt.event.*; /* * * jdbcxmpl * */ public class jdbcxmpl extends Frame { TextArea tb = new TextArea("Testing JDBC..."); Choice vndr = new Choice(); DBConnect dbc = new DBConnect(); String s = "Testing JDBC..."; public jdbcxmpl () { super("JDBC Examples Application"); initChoices(); this.setSize(600,400); Panel p = new Panel(); //p.add("East",db); p.add("Center",vndr); Panel buttons = new Panel(); buttons.add("West",new Button("MS Access")); buttons.add("Center",new Button("SQL Anywhere")); buttons.add("West",new Button("Exit")); this.add("Center",tb); this.add("North",p); this.add("South", buttons); this.show(); } public static void main (String args[]) { jdbcxmpl app = new jdbcxmpl(); } public boolean handleEvent (Event evt){ if ("Exit".equals(evt.arg)) { tb.setText("Exiting..."); this.dispose(); System.exit(0); return true; } if ("MS Access".equals(evt.arg)) { dbc.SetConnectionInfo(vndr.getSelectedItem(),"Access"); dbc.ExecQuery("Select FirstName,LastName from Employees",tb); return true; } if ("SQL Anywhere".equals(evt.arg)) { dbc.SetConnectionInfo(vndr.getSelectedItem(),"SQL Anywhere"); dbc.ExecQuery("Select emp_fname,emp_lname from Employee",tb); return true; } return super.handleEvent(evt); } public void initChoices () { vndr.addItem("Symantec"); vndr.addItem("IDS Driver"); } public void setChoices () { } }