Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java NetBeans (Database) 1. Create a DisplayFaculty class. (We are going to get Faculty database using SQL database) 2. We want to create a GUI

Java NetBeans (Database)

1. Create a DisplayFaculty class. (We are going to get Faculty database using SQL database)

2. We want to create a GUI that looks like the below figure.

image text in transcribed

3. When File -> Connect is clicked; Put up an Input Dialog that asks for a database name. If the name entered is not "javabook" put up an error dialog box saying "Database not found". If the user inputs "javabook" store the input from the user in a String variable called database_name. Set the text in the left hand Label to "Connected to xxx" where xxx is the database_name variable value. Then connect to the javabook database.

4. When File Close is clicked; Change the display of the database name to none, and close the connection to the javabook database

5. When Edit Search is clicked; Check to see if the database_name is null. If so put up an Error dialog. If the database name is not null put up an Input Dialog requesting a Faculty ssn number. Store the input from the user in a String variable called search_id. Then using the database name the user entered (which should be "javabook") and using the ssn the user input (could end with the wild card "%") do a select on the Faculty table in the javabook database to retrieve ssn, first name, last name and phone for all matching ssns. Then put that data into the TableView. Set the right hand Label to "Number of faculty = n" where n is the number of lines of data.

Note your code must support an exact match on ssn in which one row will be in the result set. And your code must support the wild card. For example if your user input "111%" as the ssn then you should get back all the matching Faculty rows in the result set and display them all in your program.

An example of the display of a wild card entry is show in below.

image text in transcribed

Display Faculty ssn First Name Last Name Phone No content in table Not Connected Number of Faculty Illustration 1 Display Faculty ssn First Name Last Name Phone No content in table Not Connected Number of Faculty Illustration 1

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_2

Step: 3

blur-text-image_3

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

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

5. Structure your speech to make it easy to listen to

Answered: 1 week ago