Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I've create both java files and added all required fields. However, I need help with the code for the actionlisteners for each button. CityDBQuery.java Constructor

image text in transcribed

I've create both java files and added all required fields. However, I need help with the code for the actionlisteners for each button.

CityDBQuery.java Constructor accepts query as a String Connects to CityDB Executes query Get the number of rows from result set Get a metadata object for the result set. Create an array of Strings for the column names. Store the column names in the array. Create a 2D String array for the table data. Loop through resultset rows Store the columns in the 2D array. Go to the next row in the ResultSet. Close the statement and connection objects.

PopulationDemo.java Constructor Set the window title to "Your Name CIS 285 Assignment 8 Specify an action for the close button. Build Table Panel that holds the table that will be displayed to the user. Build Button PanelA to hold the sorting and total buttons. Build Button PanelB to hold the average, highest, lowest, and Exit buttons. Add the panels to the content pane using BorderLayout Pack and display. buildTablePanel method builds a panel to hold the table that will be displayed to the user. buildButtonPanelA method builds a panel to hold the sorting and total buttons. buildButtonPanelB method builds a panel to hold the average, highest, lowest, and Exit buttons. updateDisplayTable method updates the table that will be displayed to the user(given below) Add AtionListener events for each Button

CIS 285 nment 8- CH17 Population Database O X Assig Cit Name Population Beijing 125ET Buenos Aires 1.317E7 Cairo 1.445E7 Calcutta 1.51E7 Delhi 1.868E7 Jakarta 1.89E7 Karachi 1.18E7 Lagos 1.3488E7 London 1.287 5E7 os Angeles 1.525E7 Manila 1.63E7 Mexico City 2.045E7 Moscow 1.5E7 Mumbai 1.92E7 New York 1.975E7 Osaka 1.735E7 Sao Paulo 1.885E7 Seoul 2.055E7 Shanghai 1.665E7 Tokyo 3245ET Sort Ascending Sort Descending Sort Name Get Total Get Average Get Highest Get Lowest Ext 1. Create the City database in SQL Express 2. Populate the table using CreateCityDBjava found in code gaddis Chapter 17.zip 3. Modify the connection string to use SQL Express 4. Create 2 java files City DBQuery java Population Demoja

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions