Example 7-1 */ import java.awt.*; import java.applet.Applet; import java.sql.*; public class example71 extends java.applet.Applet { String url; String Name; Connection con; TextArea OutputField = new TextArea(10,35); NFBarchartApp bar; // This is the bar chart class from the NetCharts package public void init() { setLayout(new BorderLayout()); url=”jdbc:msql://elanor/jdbctest”; // The URL for the database we wish to connect to ConnectToDB(); // Connect to the database. add(”North”, OutputField); // Add the TextArea for showing the data to the user String columnData[] = getData(”select * from Employee”); // Run a query that goes and gets the complete table listing; we can put // any query here and would optimally want to get only the columns we // need. ShowFormattedData(columnData); // Show the data in the TextArea ShowChartData(columnData[3],columnData[2]); // Now, pass the two data sets and create a bar chart add(”Center”, bar); // And add the bar chart to the applet’s panel } public void ShowFormattedData(String[] columnD ) { int i; for ( i=0; i< columnD.length; i++) { OutputField.appendText(columnD[i]+"n"); } } public void ConnectToDB() { try { new imaginary.sql.iMsqlDriver(); con = DriverManager.getConnection(url, "prpatel", ""); } catch( Exception e ) {
Don’t want to have just any web hosting, but web hosting provider who will share the same beliefs? You have found them. Our Church Web Hosting company will treat in you in appropriate way, the one you are accustomed to.